问题
My app uses view controllers each containing 2 container views as intermediaries between a tab bar controller and navigation controllers. This is for the purpose of managing a menu that is embedded in one of the container views in each intermediary.
I need to hide the tab bar (aka bottom bar).
I have tried sending setHidesBottomBarWhenPushed:YES
to every view controller, and I have tried selecting "hides bottom bar on push" in the storyboard for every VC.
Why aren't these things working? I assume it must be something about my architecture:
As you can see, the navigation controllers are embedded within container views whose VCs are linked to the tab bar controller.
How can I hide the tab bar in this situation?
回答1:
setHidesBottomBarWhenPushed: has to do with the optional toolbar that can be added to a navigation controller, not the tab bar. I think that if you add the line self.tabBarController.tabBar.hidden = YES; to the initial controller in each tab (the one with the container view), it will hide the tab bar. I think though, that it will leave a space at the bottom where the tab bar was. I'm not sure what the best way to fix that would be. Perhaps, if you're hiding the tab bar, you shouldn't be using a tab bar controller at all.
来源:https://stackoverflow.com/questions/16661240/cant-make-tab-bar-hidden-when-using-container-views