首页 > 技术文章 > iOS6_自动约束 Constraints

tbfirstone 原文

取消Constraints(约束)

问题描述:xib文件设计的时候控件已经摆好位置,但是每次调试的时候控件的位置又乱了

解决方法:选中 xib文件,在右侧第一项(Identity and type)的Interface Builder Document 中取消 Use AutoLayout 选项即可。

建议:这种自动约束出现在ios6及以后版本,对iphone横屏、竖屏切换时控件的布局控制很有效,取代了以前用繁琐的代码实现方式,当然也可用于iPhone、ipad界面,比较实用,建议学习使用自动约束。

学习网址:

英文:http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2

中文翻译:http://blog.sina.com.cn/s/blog_5a6efa330101d5sx.html

推荐阅读