Alex
Alex

Reputation: 11157

hide tabbarcontroller

I have a UITabBarController with multiple tabs. When i push a viewController that is a gallery, i hide the tab bar using self.hidesBottomBarWhenPushed = YES but i need to navigate from this gallery to another view controller and the tab bar controller should be displayed.

I acomplish this by setting self.hidesBottomBarWhenPushed = NO in the gallery before pushing the new view controller. The trouble is that when i go back to the gallery, the tab bar controller is visible. How can i hide it again for the gallery?

Upvotes: 1

Views: 2055

Answers (3)

Wolfert
Wolfert

Reputation: 974

In the -(void) viewWillAppear method, add this line to hide the tabbar:

 [[[self navigationController] tabBarController] tabBar].hidden = YES;

Upvotes: 3

Totumus Maximus
Totumus Maximus

Reputation: 7583

I suppose you could set the MyTabBarController.view.hidden property to YES when you go back to your gallery and load it.

Upvotes: 0

Amar Kulo
Amar Kulo

Reputation: 1108

You can add show and hide code in proper views delegate method viewWillAppear

Upvotes: 0

Related Questions