在 Xcode 故事板的一个视图上隐藏标签栏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16373170/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Hiding tab bar on one view in Xcode storyboard
提问by Jorgen
I have a Tab bar application where I would like to hide the tab bar for one of the views to exchange it with a toolbar. I am using Storyboard and by setting the Bottom Bar to None and dragging in a toolbar this looks the way I would want it on the storyboard. But when I run it the Tab bar doesn't go away.
我有一个标签栏应用程序,我想隐藏其中一个视图的标签栏以与工具栏交换它。我正在使用 Storyboard 并将底部栏设置为 None 并在工具栏中拖动,这看起来就像我希望它在故事板上一样。但是当我运行它时,标签栏不会消失。
回答by edzio27
It wont work because it only simulate the view when the tabbar is hidden. If you want to hide tabbar you have to do it programmatically.
它不会工作,因为它只在标签栏隐藏时模拟视图。如果你想隐藏标签栏,你必须以编程方式进行。
See this answer Iphone: Is it possible to hide the TabBar?
看到这个回答Iphone: Is it possible to hide the TabBar?
and try to use hideTabbar method in viewWillAppear, and showTabbar in viewDidDisapear.
并尝试在 viewWillAppear 中使用 hideTabbar 方法,在 viewDidDisapear 中使用 showTabbar。
回答by Joel Balmer
I had the same question but ended up finding my correct answer here
我有同样的问题,但最终在这里找到了我的正确答案
Essentially, you can hide the tab bar for certain view controller by checking the 'Hide bottom bar on push' check box (in the view controllers attributes inspector in the storyboard).
本质上,您可以通过选中“推送时隐藏底部栏”复选框(在故事板的视图控制器属性检查器中)来隐藏某些视图控制器的标签栏。
This might not answer all, and might not be compatible with =< iOS 5, etc, but it helped me and I hope it helps others who come here.
这可能无法回答所有问题,并且可能与 =< iOS 5 等不兼容,但它帮助了我,我希望它可以帮助到这里的其他人。
Thanks, and good luck!
谢谢,祝你好运!