ios 导航栏从我的故事板项目中消失了
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16287963/
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
Navigation bar disappeared from my storyboard items
提问by Tom
From one day to another the navigation bar disappeared from my storyboard items in XCode 4.6.2. I can't restore them (cleaning, rebuilding, closing, reopening etc)
一天又一天,导航栏从我在 XCode 4.6.2 中的故事板项目中消失了。我无法恢复它们(清洁、重建、关闭、重新打开等)
When running my app on my device or in simulator, everything works ok, the navigation bar is there. But I need them on my storyboard during design time, I have buttons, labels there those must be changed now. (pls. don't advise to do it from code, I want to do it on the storyboard graphically, I think that's why it is there)
在我的设备或模拟器上运行我的应用程序时,一切正常,导航栏在那里。但我在设计时需要它们在我的故事板上,我有按钮和标签,现在必须改变它们。(请不要建议从代码中执行此操作,我想以图形方式在情节提要上执行此操作,我认为这就是它存在的原因)
How can I get my navigation bars back? I hope the solution won't be to delete/do them again as I read in some places, because I have dozens of navigation controllers.
我怎样才能找回我的导航栏?我希望解决方案不会是我在某些地方阅读时删除/再次执行它们,因为我有几十个导航控制器。
Thanks in advance!
提前致谢!
回答by csundman
Try this:
尝试这个:
Select the view controller with the missing navigation bar and view the attributes inspector (This is the fourth tab over in the right side window). Under the simulated metrics section, change the "Top Bar" from the default "inferred" to "Navigation Bar".
选择缺少导航栏的视图控制器并查看属性检查器(这是右侧窗口中的第四个选项卡)。在模拟指标部分下,将“顶部栏”从默认的“推断”更改为“导航栏”。
Hopefully that solves your problem.
希望这能解决您的问题。
回答by Achintya Ashok
Specifically for xcode 6, under the simulated metrics section (fourth tab on the right window), under the "Top View" dropdown, pick the "Translucent Navigation Bar" to get the default nav bar.
专门针对 xcode 6,在模拟指标部分(右侧窗口的第四个选项卡)下,在“顶视图”下拉菜单下,选择“半透明导航栏”以获取默认导航栏。
回答by Ethan SK
For me I just command-A and copy, delete all view controllers, then paste back in, and it worked.
对我来说,我只是命令-A 并复制,删除所有视图控制器,然后重新粘贴,它就起作用了。
回答by Jeremy Andrews
I had a similar problem when I changed "is initial view controller" from one view/navigation controller to another within the main storyboard. I, in error, set the view controller and not the navigation controller as initial view controller. Wasted a fair bit of time on a simple mistake.
当我在主故事板中将“是初始视图控制器”从一个视图/导航控制器更改为另一个时,我遇到了类似的问题。我错误地将视图控制器而不是导航控制器设置为初始视图控制器。在一个简单的错误上浪费了相当多的时间。
回答by Anshul Garg
Try this: Select the view controller with the missing navigation bar and view the attributes inspector (This is the fourth tab over in the right side window). Under the simulated metrics section, change the "Size" from the default "inferred" to "Detail" and your navigation bar will visible again.
试试这个:选择缺少导航栏的视图控制器并查看属性检查器(这是右侧窗口中的第四个选项卡)。在模拟指标部分下,将“大小”从默认的“推断”更改为“详细信息”,您的导航栏将再次可见。