xcode 删除界面构建器中的顶部和底部布局指南
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36987927/
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
Remove the top and bottom layout guides in interface builder
提问by SimplGy
I'd like to do autolayout based on the parent view, but the top and bottom layout guides are fighting me. Thing is, I'm in an embedded view controller and they aren't relevant:
我想根据父视图进行自动布局,但顶部和底部布局指南正在与我作斗争。问题是,我在一个嵌入式视图控制器中,它们不相关:
The layout guides are here:
布局指南在这里:
I thought maybe one of these settings would remove them, but no luck:
我想也许这些设置之一会删除它们,但没有运气:
How do I get rid of these guides? If that's not possible, any info on why they get created would be really helpful.
我如何摆脱这些指南?如果这是不可能的,那么有关创建它们的原因的任何信息都会非常有帮助。
Thanks!
谢谢!
回答by black_pearl
回答by Kevin Packard
Autolayout is using an inferred status bar size.
Autolayout 使用推断的状态栏大小。
To change this, select the view controller, and show the Attributes Inspector. Change the Status Bar attribute from Inferred (as shown in your question) to None.
要更改此设置,请选择视图控制器,并显示 Attributes Inspector。将状态栏属性从推断(如您的问题所示)更改为无。
回答by denis_lor
You have to manually do that in the storyboard
. Start selecting and seeing from the top view to the inner ones and find the view
that has some visually top and bottom margin given automatically by the layout guide
.
您必须在storyboard
. 开始从顶部视图到内部视图进行选择和查看,并找到view
具有layout guide
.
When you find the view modify the "Bottom
" and "Top
" constraint
to be against "Superview
" instead of "Bottom Layout guide
" or "Top Layout guide
" and don't forget to give it a constant
of 0
instead of 20/-20 that could be applied automatically.
当您发现视图修改“ Bottom
”和“ Top
”constraint
以反对“ Superview
”而不是“ Bottom Layout guide
”或“ Top Layout guide
”时,不要忘记给它一个constant
of0
而不是可以自动应用的20/-20。