【发布时间】:2016-02-09 02:39:11
【问题描述】:
我在将某些视图旋转到横向时收到此日志:
无法同时满足约束。 以下列表中的至少一个约束可能是您不想要的。试试这个:(1)查看每个约束并尝试找出您不期望的; (2) 找到添加了一个或多个不需要的约束的代码并修复它。 (注意:如果您看到不理解的 NSAutoresizingMaskLayoutConstraints,请参阅 UIView 属性 translatesAutoresizingMaskIntoConstraints 的文档)
(
"<NSLayoutConstraint:0x17009b3f0 V:[UILabel:0x14c51ed20'Welcome to...'(>=54)]>",
"<NSLayoutConstraint:0x17009b580 V:[MyApp.LogoHeaderView:0x14c51f3e0]-(82)-[UILabel:0x14c51ed20'Welcome to...']>",
"<NSLayoutConstraint:0x17009b2b0 V:[UILabel:0x14c51ed20'Welcome to...']-(30)-[UIView:0x14c51e7e0]>",
"<NSLayoutConstraint:0x170280230 V:[MyApp.LogoHeaderView:0x14c51f3e0]-(0)-[UIView:0x14c51e7e0]>"
)
将尝试通过打破约束来恢复
<NSLayoutConstraint:0x17009b3f0 V:[UILabel:0x14c51ed20'Welcome to...'(>=54)]>
在 UIViewAlertForUnsatisfiableConstraints 创建一个符号断点,以便在调试器中捕获它。 中列出的 UIView 上的 UIConstraintBasedLayoutDebugging 类别中的方法也可能会有所帮助。
我什么都不懂。我添加了符号 UIViewAlertForUnsatisfiableConstraints 断点,但内存地址什么也没告诉我……我怎样才能以更不稳定的方式找到该日志所讨论的约束?
提前致谢
【问题讨论】:
-
@luk2302 非常感谢
标签: ios autolayout breakpoints nslayoutconstraint