开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜