IOS 7.1 issue - resizing tabs doesn't work

Since I upgraded to iOS 7.1, resizing a tab (up to 74 pixels) that no longer works:

[[tabBarController.view.subviews objectAtIndex:0] setFrame:CGRectMake(0, 0, 320, screenSize.height-73)]; [tabBarController.tabBar setFrame:CGRectMake(0, screenSize.height-73, 320, 74)]; 

This code causes the tab to move up, but with some empty space below.

How does anyone fix this?

+6
source share
2 answers

If you resize your UITabBar in the viewDidLayoutSubviews your subclass of UITabBarController , resizing will work on iOS 7 and 7.1. Take my code as an example:

 - (void)viewDidLayoutSubviews { CGFloat tabBarHeight = 39.0; CGRect frame = self.view.frame; self.tabBar.frame = CGRectMake(0, frame.size.height - tabBarHeight, frame.size.width, tabBarHeight); } 
+14
source

This is what I am using now, I deleted the image from the tab bar and then added this bit of code to place the text, I think the second line is out of date, but I will save it anyway. the for statement puts your text in the panel, so you can adjust the value to -25, 30 - the size of my tab line height. The rest of the panel is technically β€œhidden” under the screen.

 self.tabBar.frame = CGRectMake(0, screenHeight - 30, screenWidth, 30); self.view.frame = CGRectMake(0, screenHeight - 30, screenWidth, 30); for (int i = 0; i < self.tabBar.items.count; i++) { [[self.tabBar.items objectAtIndex:i] setTitlePositionAdjustment:UIOffsetMake(0, -25)]; } 
+1
source

All Articles