Uiview constraint does'ntwork

71 Views Asked by At

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.
0

There are 0 best solutions below