以下列表中的至少一個約束可能是您不想要的。試試這個:無法同時滿足約束條件?
- 看看每個約束,並試圖找出你不期望的;
- 找到添加不需要的約束或約束並修復它的代碼。
(注意:如果你看到NSAutoresizingMaskLayoutConstraints
,你不明白,參考文檔爲UIView
財產translatesAutoresizingMaskIntoConstraints
)
(
"<NSLayoutConstraint:0x7fa0a385b5a0 H:|-(0)-[UIView:0x7fa0a3855f00] (Names: '|':UIView:0x7fa0a38588a0)>",
"<NSLayoutConstraint:0x7fa0a14c5dc0 H:[UIView:0x7fa0a3855f00]-(0)-| (Names: '|':UIView:0x7fa0a38588a0)>",
"<NSLayoutConstraint:0x7fa0a141e070 H:[UIView:0x7fa0a15274e0]-(80)-| (Names: '|':UIView:0x7fa0a3855f00)>",
"<NSLayoutConstraint:0x7fa0a141e0c0 H:|-(15)-[UIView:0x7fa0a15274e0] (Names: '|':UIView:0x7fa0a3855f00)>",
"<NSLayoutConstraint:0x7fa0a380c260 H:[UIView:0x7fa0a15274e0(305)]>",
"<NSLayoutConstraint:0x7fa0a16aa700 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7fa0a38588a0(320)]>"
)
將嘗試打破約束 <NSLayoutConstraint:0x7fa0a380c260 H:[UIView:0x7fa0a15274e0(305)]>
在UIViewAlertForUnsatisfiableConstraints
上做一個符號斷點,以便在調試器中捕獲這個斷點。 <UIKit/UIView.h>
中列出的UIConstraintBasedLayoutDebugging
類別UIView
中的方法也可能有所幫助。
是啊,一個更多的是尋找同樣http://stackoverflow.com/questions/38692313/constraints-warning-in-console-i-am -not-able-to-understand –
發佈您的約束代碼或屏幕截圖。 – Catoshi
這些是約束錯誤,您需要刪除已添加的不需要的約束。 –