首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在序列图像板上启用了自动布局,但我仍然获得AutolayoutMaskContraints

在序列图像板上启用了自动布局,但我仍然获得AutolayoutMaskContraints
EN

Stack Overflow用户
提问于 2014-03-28 09:38:11
回答 1查看 955关注 0票数 0

我正在尝试做一个纯粹的基于自动布局约束的应用程序,没有自动调整大小,在我的故事板中,我在故事板的Xcode 5文件属性中打开了“使用自动布局”标志,但我仍然收到异常。我没有在代码中的任何地方启用translatesAutoresizingMaskIntoConstraints。据我所知,如果自动布局打开,IB将禁用translatesAutoresizingMaskIntoConstraints。有什么想法吗?

代码语言:javascript
复制
    Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSLayoutConstraint:0xdca62c0 V:[_UILayoutGuide:0xdca7310]-(201)-[UIView:0xcc69170]>",
    "<NSLayoutConstraint:0xdca63e0 V:[UIView:0xcc69170]-(112)-[_UILayoutGuide:0xdc51f50]>",
    "<_UILayoutSupportConstraint:0xdc581e0 V:[_UILayoutGuide:0xdca7310(52)]>",
    "<_UILayoutSupportConstraint:0xdc97780 V:|-(0)-[_UILayoutGuide:0xdca7310]   (Names: '|':UIView:0xdca7240 )>",
    "<_UILayoutSupportConstraint:0xdc7e3b0 V:[_UILayoutGuide:0xdc51f50(32)]>",
    "<_UILayoutSupportConstraint:0xdc7df20 _UILayoutGuide:0xdc51f50.bottom == UIView:0xdca7240.bottom>",
    "<NSAutoresizingMaskLayoutConstraint:0xdcce0c0 h=--& v=--& V:[UIView:0xdca7240(320)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0xdca62c0 V:[_UILayoutGuide:0xdca7310]-(201)-[UIView:0xcc69170]>

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
EN

回答 1

Stack Overflow用户

发布于 2014-03-30 01:44:40

似乎某个视图的根视图控制器一直打开着translatesAutoresizingMaskIntoConstraints。您可以在情节提要文件的xml中看到这一点。但是,所有子视图都关闭了translatesAutoresizingMaskIntoConstraints。我怀疑这是正常的行为,但如果您希望不会发生任何转换,则会有点困惑。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22702605

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档