So it is very easy to hide the tabbar when you push a view controller onto the navigation controller stack:
uiViewController.hidesBottomBarWhenPushed = YES;
works just peachy.
Put let's say I want to push deeper into the stack and show it again?
Setting
laterUIViewController.hidesBottomBarWhenPushed = NO;
on some later view controller doesn't make it reappear. It's still hidden.
You could try subclassing UIViewController
and overriding the
- (void)viewWillAppear:(BOOL)animated { self.hidesBottomBarWhenPushed = YES; }
- (void)viewWillDisappear:(BOOL)animated { self.hidesBottomBarWhenPushed = NO; }
And then using that subclass as the superclass of the view controller that you want to show the bottom bar.
This worked for me:
- (void)viewWillAppear:(BOOL)animated { self.tabBarController.tabBar.hidden = YES; }
- (void)viewWillDisappear:(BOOL)animated { self.tabBarController.tabBar.hidden = NO; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With