can't make tab bar hidden when using container views

强颜欢笑 提交于 2019-12-20 04:38:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!