How can I show a tab when pushing a UIViewController into the navigation stack

Thus, it is very easy to hide the panel when you click the view controller on the navigation controller stack:

uiViewController.hidesBottomBarWhenPushed = YES; 

works just peachy.

Put, say, I want to go deeper into the stack and show it again?

Customization

  laterUIViewController.hidesBottomBarWhenPushed = NO; 

on some later view controller it does not appear again. He is still hidden.

+7
source share
4 answers

You can try subclassing the UIViewController and overriding

 - (void)viewWillAppear:(BOOL)animated { self.hidesBottomBarWhenPushed = YES; } - (void)viewWillDisappear:(BOOL)animated { self.hidesBottomBarWhenPushed = NO; } 

And then using this subclass as the superclass of the view controller that you want to show the bottom panel.

+3
source share

This worked for me:

 - (void)viewWillAppear:(BOOL)animated { self.tabBarController.tabBar.hidden = YES; } - (void)viewWillDisappear:(BOOL)animated { self.tabBarController.tabBar.hidden = NO; } 
+2
source share

Try a workaround: if you do not plan to switch between controllers, it should work fine.

The idea is to increase the size of your tablet panel controller, so that the tab (which is at the bottom of the screen) exits the screen and restores the size of the view when you hide the view.

In your view, the controller that should hide the tab bar will determine the following methods:

 -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; CGRect r = self.tabBarController.view.frame; r.size.height +=self.tabBarController.tabbar.frame.size.height; self.tabBarController.view.frame = r; } -(void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; self.tabBarController.view.frame = CGRectMake(0, 0, 320, 480); //for iPhone portrait } 

You need to make sure that in your application the window and window control panel delegate is defined and correctly connected with XIB

 @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; 
+1
source share

Try to remove it, so you tell him to hide, he is hiding, but then you tell him not to hide him (I don’t know if he shows it if you set it to nothing), but it looks like it isn’t , either, or you tell him not to hide when the view controller in which you want the panel to be pressed, and it does not hide the panel until the next view controller is pressed, so you should try to install it as unprotected.

-one
source share

All Articles