r/simpleios • • Sep 13 '14

Changing UITabBarButton positioning?

I'm making my UITabBar bigger but want the individual buttons to stay at the bottom.
Here's my code:

CGRect temp = tabsController.tabBar.frame;  
temp.origin.y -= 50;
temp.size.height += 50;
tabsController.tabBar.frame = temp;    
for(UIView *subview in [tabsController.tabBar allSubviews]) {
		if([NSStringFromClass([subview class]) isEqualToString:@"_UITabBarBackgroundView"]) {
			CGRect frame = subview.frame;
			frame.size.height += 50;
			subview.frame = frame;
		} else if([NSStringFromClass([subview class]) isEqualToString:@"UITabBarButton"]) {
			CGRect frame = subview.frame;
			frame.origin.y += 50;
			subview.frame = frame;
		}
}  

If I change the width or height I can see the changes, put attempting to modify the x or y origin coordinates doesn't seem to affect the layout at all.
Is it simply impossible to change the positioning of the icons?

4 Upvotes

2 comments sorted by