UICollectionViewCell
自動レイアウトの制約があります。それはアスペクトとして機能しますが、私のアプリケーションは満たされていない制約に関する多くの警告を出力します:
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:0x7f9e650c50f0 UILabel:0x7f9e650c10c0'Toz Kat Elek >30'.top == UIView:0x7f9e650c0fd0.topMargin - 8>",
"<NSLayoutConstraint:0x7f9e650c51e0 UIView:0x7f9e650c17f0.top == UILabel:0x7f9e650c10c0'Toz Kat Elek >30'.top + 20>",
"<NSLayoutConstraint:0x7f9e650c5280 UIView:0x7f9e650c0fd0.bottomMargin == UIView:0x7f9e650c17f0.bottom - 8>",
"<NSAutoresizingMaskLayoutConstraint:0x7f9e650d8550 h=--& v=--& V:[UIView:0x7f9e650c0fd0(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f9e650c5280 UIView:0x7f9e650c0fd0.bottomMargin == UIView:0x7f9e650c17f0.bottom - 8>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
問題の原因を突き止めるために、さまざまな組み合わせを試しました。Debug View Hierarchy を使用してビュー階層を調べているときに、追加していない UIView があり、この UIView が原因で警告メッセージが表示されることがわかりました。
では、これらの警告メッセージを取り除くにはどうすればよいでしょうか?
アップデート
ここに私のビュー階層があります: