隐藏约束/自动布局栏,Xcode 6

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26519870/
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 05:58:00  来源:igfitidea点击:

Constraint/Autolayout bar hidden, Xcode 6

iosxcodexcode6

提问by Nshweky

In my storyboard file, I would like to add constraints, but the button to insert constraint is not shown! Any idea how to get it back?

在我的故事板文件中,我想添加约束,但未显示插入约束的按钮!知道如何取回它吗?

回答by Frankie

Make sure auto layout is enabled if you want to use the auto layout controls.

如果要使用自动布局控件,请确保启用自动布局。

Autolayout Enabled: Autolayout enabled

启用自动布局: Autolayout enabled

Autolayout Disabled: Note the controls are missing.

禁用自动布局:请注意缺少控件。

Autolayout disabled

Autolayout disabled

If you're looking to use auto layout with UIScrollView it should probably be asked in another question. But very briefly, when using auto layout, the place most people trip up is that UIScrollView determines its content size based on your constraints within the scrollview. If those are set right, you should be good to go.

如果您希望在 UIScrollView 中使用自动布局,则可能应该在另一个问题中询问。但非常简单,在使用自动布局时,大多数人会绊倒的地方是 UIScrollView 根据您在滚动视图中的约束来确定其内容大小。如果这些设置正确,你应该很高兴。

Good luck.

祝你好运。

回答by ScottyBlades

Quiting Xcode and reopening worked for me.

退出 Xcode 并重新打开对我有用。

回答by YoonHo

I found that sometimes constraints are not shown when wantsLayer property is checked in the Interface Builder. (only on OSX, not on iOS)

我发现有时在 Interface Builder 中检查 WantsLayer 属性时不会显示约束。(仅在 OSX 上,不在 iOS 上)