0

I have a problem with constraints. In my project, I have an xib file. In this xib I have UIView with a fixed height. constraits

UIView I want

UIView I have

This is what in my console:

    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. 
(
    "<NSLayoutConstraint:0x600000a62b20 UIView:0x7fcacec2dd80.height == 60   (active)>",
    "<NSLayoutConstraint:0x600000a62bc0 UIView:0x7fcacec2cdc0.height == 382   (active)>",
    "<NSLayoutConstraint:0x600000a63660 UIView:0x7fcacec2dd80.top == UILayoutGuide:0x60000100d0a0'UIViewSafeAreaLayoutGuide'.top   (active)>",
    "<NSLayoutConstraint:0x600000a638e0 V:[UIView:0x7fcacec2dd80]-(NSSpace(8))-[UIView:0x7fcacec2cdc0]   (active)>",
    "<NSLayoutConstraint:0x600000a63930 UIView:0x7fcacec2cdc0.bottom == UILayoutGuide:0x60000100d0a0'UIViewSafeAreaLayoutGuide'.bottom   (active)>",
    "<NSLayoutConstraint:0x600000a66300 'UIView-Encapsulated-Layout-Height' UIView:0x7fcacec23b60.height == 600   (active)>",
    "<NSLayoutConstraint:0x600000a63750 'UIViewSafeAreaLayoutGuide-bottom' V:[UILayoutGuide:0x60000100d0a0'UIViewSafeAreaLayoutGuide']-(0)-|   (active, names: '|':UIView:0x7fcacec23b60 )>",
    "<NSLayoutConstraint:0x600000a636b0 'UIViewSafeAreaLayoutGuide-top' V:|-(0)-[UILayoutGuide:0x60000100d0a0'UIViewSafeAreaLayoutGuide']   (active, names: '|':UIView:0x7fcacec23b60 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600000a62bc0 UIView:0x7fcacec2cdc0.height == 382   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Valter
  • 41
  • 10
  • go to this website https://www.wtfautolayout.com/ and paste your constraint – Salman500 Jul 20 '19 at 10:11
  • @Salman500, this is a site only write something like that: "This constraint was added by a table or collection view to enforce its cell size."But there weren't collection views of table views. I tried this with other's errors – Valter Jul 20 '19 at 15:34
  • Hint 1: If you are making constraints only in the storyboard, then they are unsatisfiable already in the storyboard and the storyboard will put up an error message and tell you what the problem is. If that isn't happening, change the nib editor display to a different device size, and then it will happen. Now you can easily diagnose and fix the issue. – matt Jul 21 '19 at 13:30
  • Hint 2: Go back into the storyboard and give every one of your constraints a meaningful _identifier_ string so that we can tell which view is which in your unsatisfiable constraint output. Then if you get issues at runtime it will be clear where the problem lies. – matt Jul 21 '19 at 13:31

0 Answers0