我有一些自動佈局的問題。一切變得所示正確的,一切工作正常,但我得到的命令行一些警告信息: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