ios 如何删除警告“按钮的框架在运行时会有所不同。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18621346/
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
How to Remove the Warning "Frame for Button will be different at run time."
提问by sohail059
I am using Xcode 5 developer preview. When I change or add a in the XIB file from interface builder Xcode shows this warning:
我正在使用 Xcode 5 开发人员预览版。当我从界面生成器的 XIB 文件中更改或添加 a 时,Xcode 显示此警告:
Frame for Button will be different at run time.
按钮的框架在运行时会有所不同。
How do I remove this warning?
如何删除此警告?
采纳答案by abdus.me
Probably you have created a conflict in constraints. To resolve it Open nib file Go to editor > Resolve all constraint issues> from there you can reset all/desired constraints.
可能您在约束中产生了冲突。要解决它 打开 nib 文件转到编辑器 > 解决所有约束问题 > 从那里您可以重置所有/所需的约束。
回答by Pritesh Desai
This warning is displayed when the actual position of the element is different in your storyboard than while running the app.
当故事板中元素的实际位置与运行应用程序时不同时,会显示此警告。
You can select that element and then hit Option+Cmd+=.
您可以选择该元素,然后点击Option+ Cmd+ =。
This will update the position of the element in the storyboard and that warning will go away.
这将更新故事板中元素的位置,该警告将消失。
You can also find this option in menu under Editor > Resolve Auto Layout Issues > Update Frames
.
您也可以在 下的菜单中找到此选项Editor > Resolve Auto Layout Issues > Update Frames
。