我有一些自动布局的问题。一切变得所示正确的,一切工作正常,但我得到的命令行一些警告信息:Autolayout显示警告消息
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:0xb6a60f0 H:[UIImageView:0xb645e40(75)]>",
"<NSLayoutConstraint:0xb6d0e90 H:[UIView:0xb6c7350(220)]>",
"<NSLayoutConstraint:0xb6aaea0 H:|-(10)-[UIImageView:0xb645e40] (Names: '|':UITableViewCellContentView:0xb6c1590)>",
"<NSLayoutConstraint:0xb6c85c0 H:[UIView:0xb6c7350]-(7)-| (Names: '|':UITableViewCellContentView:0xb6c1590)>",
"<NSLayoutConstraint:0xb6d2270 H:[UIImageView:0xb645e40]-(8)-[UIView:0xb6c7350]>",
"<NSAutoresizingMaskLayoutConstraint:0xb6abd20 h=--& v=--& H:[UITableViewCellContentView:0xb6c1590(300)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0xb6d0e90 H:[UIView:0xb6c7350(220)]>
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.
这是我的笔尖文件的外观:
正如你可以看到它的一个TableViewCell我使用一个视图(示例文本)与TextView(用于iOS7)和AttributedTextView(用于iOS6)!
最新问题?
感谢您的提示,我会尽力删除每一个约束...... – Davis
我个人不喜欢使用“添加缺少约束”选项。它相当难以预测,相反你应该调试出错的地方并自己清除它。如果X-Code拧紧,可以节省很多时间。 – footyapps27
@ footyapps27,一般来说,你是对的。但是,如果你正在治疗约束 - 添加缺失的约束是一个快速的解决方案。 – Raz