In my app I have a tab bar. And in some views I as well have a toolbar. So when I come to those views with a toolbar it looks ugly - two bars at the bottom of the view. I th
You have to use set the hidesBottomBarWhenPushed property to YES on the controller that you are pushing and NOT to the UITabBarController.
otherController.hidesBottomBarWhenPushed = YES;
[navigationController pushViewController: otherController animated: TRUE];
Or you can set the property when you first initialize the controller you want to push.
Interface builder has checkbox for view controller embedded in tab bar - Hides bottom bar on push. In easy cases no need to do it through code now.
For @Micah
I too struggled with this for a while. Hiding the tab bar is one step in the right direction, but leaves a black rectangle behind. The trick is to resize the layer that backs the UIViewController's view.
I have written a small demo here with a solution:
https://github.com/tciuro/FullScreenWithTabBar
I hope this helps!
Don't use this solution!
BOOL hiddenTabBar;
UITabBarController *tabBarController;
- (void) hideTabBar {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.4];
for(UIView *view in tabBarController.view.subviews)
{
CGRect _rect = view.frame;
if([view isKindOfClass:[UITabBar class]])
{
if (hiddenTabBar) {
_rect.origin.y = [[UIScreen mainScreen] bounds].size.height-49;
[view setFrame:_rect];
} else {
_rect.origin.y = [[UIScreen mainScreen] bounds].size.height;
[view setFrame:_rect];
}
} else {
if (hiddenTabBar) {
_rect.size.height = [[UIScreen mainScreen] bounds].size.height-49;
[view setFrame:_rect];
} else {
_rect.size.height = [[UIScreen mainScreen] bounds].size.height;
[view setFrame:_rect];
}
}
}
[UIView commitAnimations];
hiddenTabBar = !hiddenTabBar;
}
Source