This happens in iOS7 when you set tabBar.translucent
to NO
. iOS is trying to be smart and say "hey the tabbar is not translucent so we better push everything up on top of it". Fix it by setting the extendedLayoutIncludesOpaqueBars
property of the view controller inside the navigation controller which is inside the tabbar controller to YES
.
Example (not actually ran):
UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.tabBar.barStyle = UIBarStyleBlack;
tabBarController.tabBar.translucent = NO;
UIViewController *viewController = [[UIViewController alloc] init];
viewController.extendedLayoutIncludesOpaqueBars = YES; // <-- This is important!!!!!!
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController: viewController];
tabBarController.viewControllers = @[navigationController];
And BTW, I like the non-translucent tabbar the best.
Edit
As Andy mentioned below, this flag does not have to be set in code. You can set it in IB if that's what you use.