Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding UITabBar when pushing a UIView

I have a UITabBarController where the default view controller is a UINavigationController. I want to be able to hide the UITabBar of the UITabBarController when I push a certain view in the UINavigationController.

I've tried adding:

delegate.tabBarController.hidesBottomBarWhenPushed = YES; 

in my UINavigationController before I push the view, but that doesn't seem to do the trick.

Any tips on what I should be doing or if it's even possible? Thanks in advance!

like image 969
Benny Wong Avatar asked Mar 24 '09 01:03

Benny Wong


People also ask

How do I hide tabBar when pushing?

You can do this in storyboard now: Select the UIViewController in your storyboard. Select the checkbox Hide Bottom Bar on Push.

How do you hide the tab bar when a view controller is shown?

If you don't want that behavior, you should set hidesBottomBarWhenPushed to true where applicable. This will hide the tab bar along with any toolbars you had showing, but only when a view controller is pushed onto the navigation stack. This allows you to show the tab bar at first, then hide it when you need more room.


1 Answers

This is better:

viewController.hidesBottomBarWhenPushed = YES; [self.navigationController pushViewController:viewController animated:YES]; 

You have to set hidesBottomBarWhenPushed = YES on the controller you are going to push into the view...

like image 133
hfossli Avatar answered Sep 30 '22 18:09

hfossli