How to hide the tabBar when push a view?

wjldxt picture wjldxt · Jan 2, 2012 · Viewed 20k times · Source

My application is a Tabbed Application, and it have several controllers under the tabBarController. One controller is a navigationController, and its root view is a table view. When I click a row of the table view, another view will be pushed in. So the question is that when the view is pushed in, how can I hide the tabBar at the bottom? Besides, I also want to add another tabBar into the pushed view, so I need to alloc a UITabBar or UITabBarController? Or there is another way? Thank you!

Answer

Bonnie picture Bonnie · Jan 2, 2012

use this methood in the UIViewController class where you want to hide the tabBarController

-(BOOL)hidesBottomBarWhenPushed
{
    return YES;
}

Update

As suggested by @Yuchen Zhong in his answer, This option is now available in the storyboard itself.

enter image description here