简体   繁体   English

Xcode 4.5 + UIScrollView:看不到支柱和弹簧(OSX 10.8 Mountain Lion)

[英]Xcode 4.5 + UIScrollView: Cannot see struts and springs (OSX 10.8 Mountain Lion)

Disclaimer: Brand new to iOS dev. 免责声明: iOS开发全新。 Go easy on me. 放轻松我。

Got a funny situation in Xcode 4.5. 在Xcode 4.5中有一个有趣的情况。 My Size Inspector looks like this: 我的尺寸检查器看起来像这样:

在此输入图像描述

...and I can't see the struts and springs area at all . ......我根本看不到支柱和弹簧区域

The really strange part is that when I click away to something like the Connections inspector I do see the struts and springs area, but only for a split second, and it is gone when I come back. 真正奇怪的是,当我点击连接检查器之类的东西时,我确实看到了支柱和弹簧区域,但只是一瞬间,当我回来时它就消失了。

Is this normal? 这是正常的吗? Is there an easy way to correct this behavior? 有没有一种简单的方法来纠正这种行为?

In Xcode 4.5, for iOS 6 and OSX 10.8 development, AutoLayout is being enabled by default. 在Xcode 4.5中,对于iOS 6和OSX 10.8开发,默认情况下启用AutoLayout。

To turn it off, open your xib file and click on a blank spot (not on a view or any component). 要将其关闭,请打开xib文件并单击空白处(不在视图或任何组件上)。 On the inspector panel, select the first tab and remove the "Use Autolayout" checkbox. 在检查器面板上,选择第一个选项卡,然后删除“使用Autolayout”复选框。 Your springs and struts will be back. 你的弹簧和支柱会回来。

在此输入图像描述

You have Autolayout enabled for the view, turn that off and it will look like what you expect. 您为视图启用了Autolayout,将其关闭,它看起来就像您期望的那样。 Autolayout is a new feature for iOS6 that allows more granular control of how things are laid out, and really enhances what was previously available via the struts and sprints via autoresizing masks. Autolayout是iOS6的一项新功能,它允许更精细地控制事物的布局,并通过自动调整掩码真正增强以前通过struts和sprint提供的功能。

To turn if off, open the Identify Inspector, and uncheck "Use Autolayout" 要关闭,请打开识别检查器,然后取消选中“使用Autolayout”

在此输入图像描述

与其他两个答案相同,但对于使用故事板的项目:您可以只打开故事板以查看检查器面板中的“使用Autolayout”复选框,而不是打开xib文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM