xcode 如何让 Autosize 功能在 Interface Builder 中显示对象?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10567876/
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 do I get Autosize feature to show up for objects in Interface Builder?
提问by bieno002
I'm brand new to Mac OS X development and to Xcode and the Cocoa framework. I've been working through the "Your First Mac App" tutorial on the Apple's developer website and have run into a snag. I've made it most of the way through but am hung up in the section where it shows you how to use Autosizing on the gui objects. When I click on the slider(or any of the objects) and then select the size inspector I do not have any of the autosize items in the inspector window like it shows in the tutorial. How do I get those options to show up?
我是 Mac OS X 开发以及 Xcode 和 Cocoa 框架的新手。我一直在学习 Apple 开发者网站上的“你的第一个 Mac 应用程序”教程,但遇到了一个障碍。我已经完成了大部分工作,但在向您展示如何在 gui 对象上使用自动调整大小的部分中被挂断了。当我单击滑块(或任何对象)然后选择大小检查器时,检查器窗口中没有任何自动调整大小的项目,如教程中所示。我如何让这些选项显示出来?
回答by DrummerB
This is a new feature in XCode 4 called Constraints. It's just an other way to define how your user interface should be resized when the window (or parent view) is resized. If you want to use the Autoresizing Mask settings from the tutorial, go to the File Inspector (first tab on the right) and uncheck Use Auto Layout.
这是 XCode 4 中名为Constraints的新功能。这只是定义在调整窗口(或父视图)大小时如何调整用户界面大小的另一种方式。如果您想使用教程中的 Autoresizing Mask 设置,请转到 File Inspector(右侧的第一个选项卡)并取消选中 Use Auto Layout。