I have a UICollectionViewCell
with autolayout constraints. It works as aspected but my application prints a lot of warnings about unsatisfied 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)
(
"<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.
I have tried lots of different combinations to find out the source of the problem. While inspecting my view hierarchy with Debug View Hierarchy I found out that there is an UIView that I didn't add and this UIView causes the warning messages.
So how can get rid of these warning messages?
UPDATE
Here is my view hierarchy: