Xcode 8 问题:“导航栏”的框架在运行时会有所不同
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39633338/
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
Xcode 8 Issue : Frame for "Navigation Bar" will be different at run time
提问by Ashish Kakkad
When we Embed your view controller in Navigation Controller. Then facing issue with navigation bar.
当我们将您的视图控制器嵌入到导航控制器中时。然后面临导航栏的问题。
Xcode 8 Issue : Frame for "Navigation Bar" will be different at run time.
Xcode 8 问题:“导航栏”的框架在运行时会有所不同。
Note : When we hide the navigation bar and show it again then issue gone away. And after when we open the storyboard then issue raise again.
注意:当我们隐藏导航栏并再次显示时,问题就消失了。在我们打开故事板之后,再次发出 raise。
Also I have tried to do as answergiven here. It's not working. If you open storyboard again then this issue raise again.
我也尝试按照此处给出的答案进行操作。它不工作。如果您再次打开故事板,则会再次引发此问题。
Same issue is there with Xcode 8.1
Xcode 8.1 也有同样的问题
How can we resolve this issue?
我们如何解决这个问题?
This issue is resolved in Xcode 10.
此问题已在 Xcode 10 中解决。
回答by Amanpreet
In View Controller's attribute you can see "Simulated Metrics". Change the "Size" attribute to "Freeform" instead of "Inferred". This will remove the warning.
在视图控制器的属性中,您可以看到“模拟指标”。将“Size”属性更改为“Freeform”而不是“Inferred”。这将删除警告。