簡體   English   中英

沖突的自動版式約束?

[英]Conflicting AutoLayout Constraints?

運行我的代碼時,出現以下錯誤:

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) 
(
    "<_UIScrollViewAutomaticContentSizeConstraint:0x7a09e6a0 UITableView:0x7c1d4400.contentHeight{id: 178} == -5.000000>"
)

Will attempt to recover by breaking constraint 
<_UIScrollViewAutomaticContentSizeConstraint:0x7a09e6a0 UITableView:0x7c1d4400.contentHeight{id: 178} == -5.000000>

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.

我如何找到此問題的根源?

您只需在表視圖中添加額外的約束,然后刪除不需要添加表視圖的約束即可。 它在您的contentHeight中顯示了問題。 只需刪除contentHeight並在其中添加適當的約束即可。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM