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!
Here's how you get this to work:
In the
Application Delegate
you create theUITabBarController
. Then you create aUINavigationController
with its root controller as the view controller you want in the particular tab. Then insert theUINavigationController
into the "viewControllers" array of theUITabBarController
. like so:This way you can set the "
hidesBottomBarWhenPushed
" property to "YES
" in any view controller inside thatUINavigationController
and it will hide theUITabBar
.Hope that helps!
It turns out that if you set the view
hidesBottomBarWhenPushed:YES
it hides the bar when the view appears (duh on my part). I was assigning it to theUITabBarController
, which doesn't make too much sense when you think about it.