导航栏宽度的 Xcode 8 Storyboard 警告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39492765/
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 Storyboard warnings for Navigation Bar width
提问by jakedunc
I am getting constraint warnings for my Navigation Bar's for each of my Navigation Controllers in each of my storyboards in Xcode 8.
我在 Xcode 8 的每个情节提要中的每个导航控制器的导航栏都收到约束警告。
To get rid of the warning I set the Navigation Controller's Simulated Metrics->Top Bar setting from Inferred to None and then back again, and the warning goes away. Until the next time the storyboard is opened, then the warnings come back.
为了摆脱警告,我将 Navigation Controller 的 Simulated Metrics->Top Bar 设置从 Inferred 设置为 None 然后再回来,警告消失了。直到下次打开故事板时,警告才会回来。
My storyboard has the iPhone SE display setting, and the navigation bar's are not Translucent.
我的故事板有 iPhone SE 显示设置,导航栏不是半透明的。
回答by IanW
Changing the device preview from iPhone SE also removes the warning.
从 iPhone SE 更改设备预览也会删除警告。
Xcode 8 has some serious bugs in Interface Builder: as well as this one, it has a nasty habit of random-seeming frame changes to all sorts of views - in my Main.storyboard, it decided to make some keyboard input accessory views 1,000 by 1,000 points, and everything inside it had a frame of {0,0} - {1000,1000}.
Xcode 8 在 Interface Builder 中有一些严重的错误:除此之外,它还有一个讨厌的习惯,即对各种视图进行随机的帧更改 - 在我的 Main.storyboard 中,它决定让一些键盘输入附件视图 1,000 1,000 个点,它里面的所有东西都有一个 {0,0} - {1000,1000} 的框架。
Did the same thing to various UITableViewCells, but not all of them.
对各种 UITableViewCells 做了同样的事情,但不是全部。
Changing everything back took ages, cleaned the build folder and recompiled, but the problem came back straight away as soon as the storyboard was opened.
将所有内容改回来需要很长时间,清理构建文件夹并重新编译,但是一旦故事板打开,问题就会立即出现。
I had to uninstall 8 and go back to 7.3.1, I filed a radar, saw other people with the same problem on the dev forums.
我不得不卸载 8 并返回 7.3.1,我提交了一个雷达,在开发论坛上看到其他人有同样的问题。
回答by Yigit Alp Ciray
I encountered with the same problem. I am not sure that is solution or not but I just changed the Simulated Metrics size which is page size from freeform to the Page Sheet and warning dissappeard
我遇到了同样的问题。我不确定这是否是解决方案,但我只是将模拟指标大小(页面大小从自由格式更改为页面表)并警告消失了
回答by CoderPug
Regarding the issues of Xcode automatically moving some views/subviews to {0, 0, 1000, 1000} frame bug, which is related to main question:
关于Xcode自动将一些视图/子视图移动到{0, 0, 1000, 1000}帧错误的问题,与主要问题有关:
I had the same problem. Make sure to use Xcode 8.1 now as this problem is fixed in that version.
我有同样的问题。请确保现在使用 Xcode 8.1,因为该问题已在该版本中修复。
Xcode 8.1 Release notes https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
Xcode 8.1 发行说明 https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
Radars related : 28221021, 28244619
雷达相关:28221021、28244619
Update -Pointing the explicit frame bug solved on Xcode 8.1
更新 -指出在 Xcode 8.1 上解决的显式帧错误