I have gotten in trouble while using hidesBottomBarWhenPushed... I will push three controllers – A, B, and C – into navigationcontroller in order, and I would like to hide bottom tab bar when B is shown.(and A is one of the tabbar controllers)
Does any one have ideas?
In view controller A (which is on the tabBar), when it comes time to present B (no tabBar wanted):
self.hidesBottomBarWhenPushed = YES; // hide the tabBar when pushing B
[self.navigationController pushViewController:viewController_B animated:YES];
self.hidesBottomBarWhenPushed = NO; // for when coming Back to A
In view controller B, when it comes time to present C (tabBar wanted again):
self.hidesBottomBarWhenPushed = NO; // show the tabbar when pushing C
[self.navigationController pushViewController:viewController_C animated:YES];
self.hidesBottomBarWhenPushed = YES; // for when coming Back to B
Instead of setting it in viewDidLoad, I have found that sometimes this is too late. Set it in init or override hidesBottomBarWhenPushed to return YES for views with no bottom toolbar.
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