How to hide/show tab bar of a view with a navigation bar in iOS?
You can set the UIViewController.hidesBottomBarWhenPushed instead:
DetailViewController *detailViewController = [[DetailViewController alloc] init];detailViewController.hidesBottomBarWhenPushed = YES;[[self navigationController] pushViewController:detailViewController animated:YES]; [detailViewController release];
You can also do this in the Interface Builder for a storyboard. Select the View Controller that you want to hide the Tab Bar for and then select "Hide Bottom Bar on Push".
I just created a category on UITabBarController that allows you to hide the TabBar, optionally with an animation:
https://github.com/idevsoftware/Cocoa-Touch-Additions/tree/master/UITabBarController_setHidden
It adds the tabBarHidden
property (with isTabBarHidden
as its getter) and the - (void)setTabBarHidden:(BOOL)hidden animated:(BOOL)animated
method.