2017-08-23 100 views
0

Tableview在iphone5中顯示,但在iphone 5以外,我得到這個警告。有人知道這是什麼警告?Autolayouts警告,無法同時滿足約束

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. 
(
    "<NSLayoutConstraint:0x60800008a820 UIImageView:0x7f8193515be0.height == 0.75*UITableViewCellContentView:0x7f81935153f0.height - 21 (active)>", 
    "<NSLayoutConstraint:0x60800008d2a0 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7f81935153f0.height == 0.5 (active)>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60800008d2a0 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7f81935153f0.height == 0.5 (active)> 
+1

可能重複[無法同時滿足約束,將嘗試通過打破約束來恢復](https://stackoverflow.com/questions/11664115/unable-to-simultaneously-satisfy-constraints-will-attempt-to-通過中斷恢復) –

+0

請參閱以下相關鏈接 https://stackoverflow.com/a/36863042/8472539 https://stackoverflow.com/a/14327470/8472539 – Bin0li

回答

0

你有一個約束衝突,你可以通過給約束添加不同的優先級或者刪除其中的一個來解決這個問題。 您也可以提供所有使用修復ID的視圖,以取代「UIImageView:0x7f8193515be0.height」,它會顯示'id name'.height。通過這種方式,您可以看到哪些視圖遇到約束問題。 你應該學習自動佈局,如果你不想再有這些問題...... AutoLayout guide

0

首先,嘗試改變優先級每個高度限制在您的表視圖細胞至少999.f 顯然,你有一個高度限制的問題。

相關問題