【发布时间】:2015-07-24 07:57:23
【问题描述】:
我将 UILabel 放入 UIView xib。我的 tableView 在 tableHeaderView 中包含该视图。 标签有下一个约束:
在运行时,我在控制台中收到下一个警告:
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:0x7feaf3969800 H:|-(77)-[UILabel:0x7feaf3968e00'ThreeWithLngNameVeryLong ...'] (Names: '|':HeaderView:0x7feaf3968040 )>",
"<NSLayoutConstraint:0x7feaf39698a0 H:[UILabel:0x7feaf3968e00'ThreeWithLngNameVeryLong ...']-(16)-| (Names: '|':HeaderView:0x7feaf3968040 )>",
"<NSLayoutConstraint:0x7feaf397b4d0 'UIView-Encapsulated-Layout-Width' H:[HeaderView:0x7feaf3968040(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7feaf39698a0 H:[UILabel:0x7feaf3968e00'ThreeWithLngNameVeryLong ...']-(16)-| (Names: '|':HeaderView:0x7feaf3968040 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
也许有人知道出了什么问题?
【问题讨论】:
标签: ios8 autolayout constraints