Hiding UITabBar when showing UIViewController as modal
I've got a UIViewController that has a modal window which I'd like to present over the entire interface, including the UITabBar.
My application hierarchy is this:
UITabBarController (A) ->
UIViewController (B) ->
UINavigationController (C) ->
UIViewController (D) ->
UIViewController (my modal view)
When I call presentModalViewController
on D, the modal view is presented开发者_开发问答 but underneath the UITabBar, or should I say, the UITabBar is still shown.
I've tried setting the hidesBottomBarWhenPushed
property to YES
on the modal view controller, but to no avail.
Any ideas on why this isn't working for me?
The modal ViewController
needs to be a direct child of the TabBarController
in order to do what you want.
in ViewController "D", instead of :
[self presentModalViewController:...];
do:
[tabBarController presentModalViewController:...];
how you maintain a reference to the TabBarController
is up to you.
精彩评论