d2kagw
d2kagw

Reputation: 807

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?

Upvotes: 1

Views: 2528

Answers (1)

codelark
codelark

Reputation: 12324

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.

Upvotes: 3

Related Questions