【发布时间】:2014-10-26 10:24:23
【问题描述】:
我怎么知道哪些约束冲突?
2014-10-26 12:31:55.713 MyApp[17769:2430918] Unable to simultaneously satisfy constraints.
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:0x79646340 V:[UIImageView:0x796475f0]-(0)-| (Names: '|':UIView:0x79641bc0 )>",
"<NSLayoutConstraint:0x796463a0 V:[UILabel:0x79636150'my settings']-(19)-[UIImageView:0x796475f0]>",
"<NSLayoutConstraint:0x79646430 V:|-(20)-[UILabel:0x79636150'my settings'] (Names: '|':UIView:0x79641bc0 )>",
"<NSAutoresizingMaskLayoutConstraint:0x79640030 h=-&- v=-&- UIView:0x79641bc0.height == _UITableViewHeaderFooterContentView:0x79639c70.height>",
"<NSLayoutConstraint:0x7963a190 'UIView-Encapsulated-Layout-Height' V:[_UITableViewHeaderFooterContentView:0x79639c70(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x796463a0 V:[UILabel:0x79636150'my settings']-(19)-[UIImageView:0x796475f0]>
【问题讨论】:
-
看起来错误是告诉您表格页脚视图的高度为 0 像素高,但您的 [UIlabel]-19-[imageView] 与它冲突。
-
您好,请您添加限制被打破的图像。还有你是如何设置布局约束的。
-
您好,请问您是如何设置约束的以及表格页脚视图的高度是多少。据说它试图通过破坏 'V:[UILabel:0x79636150'my settings']-(19)-[UIImageView:0x796475f0]>' 来设置视图,因为它没有得到适当的高度。那么请您记下表格页脚视图的高度以及您是如何设置约束的。
-
页脚的高度是在运行时使用委托方法定义的,它与 xib 文件中给出的高度相匹配
标签: ios nslayoutconstraint ios-autolayout