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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:47:00  来源:igfitidea点击:

Remove the top and bottom layout guides in interface builder

xcodeautolayoutinterface-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:

我想根据父视图进行自动布局,但顶部和底部布局指南正在与我作斗争。问题是,我在一个嵌入式视图控制器中,它们不相关:

enter image description here

在此处输入图片说明

The layout guides are here:

布局指南在这里:

enter image description here

在此处输入图片说明

I thought maybe one of these settings would remove them, but no luck:

我想也许这些设置之一会删除它们,但没有运气:

enter image description here

在此处输入图片说明

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 Juan

Remove the top and bottom layout guides pic

删除顶部和底部布局指南图片

enter image description here

在此处输入图片说明

回答by black_pearl

Simply to deselect and reselect Use Safe Area Layout Guides, as Apple deprecated Top Layout Guide

只需取消选择和重新选择Use Safe Area Layout Guides,因为 Apple 已弃用Top Layout Guide

@Daniel Storm's answer is more accurate.

@Daniel Storm 的回答更准确。

@Juan's answer is good , not very ok.

@Juan 的回答很好,不太好。

13

13

2

2

回答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 viewthat 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" constraintto be against "Superview" instead of "Bottom Layout guide" or "Top Layout guide" and don't forget to give it a constantof 0instead of 20/-20 that could be applied automatically.

当您发现视图修改“ Bottom”和“ Topconstraint以反对“ Superview”而不是“ Bottom Layout guide”或“ Top Layout guide”时,不要忘记给它一个constantof0而不是可以自动应用的20/-20。