在使用自动布局时,能正常运行,但是控制台不断的报下面的错误:
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:0x7fe5d0557c80 V:[UIView:0x7fe5d0571ab0(224)]>", "<NSLayoutConstraint:0x7fe5d055b940 UIView:0x7fe5d0571ab0.width == 1.42857*UIView:0x7fe5d0571ab0.height>", "<NSLayoutConstraint:0x7fe5d05612e0 H:|-(0)-[UIView:0x7fe5d0571ab0] (Names: '|':UIView:0x7fe5d055c790 )>",
Will attempt to recover by breaking constraintMake a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.The methods in the UIConstraintBasedLayoutDebugging category on UIView listed inmay also be helpful
解决方法:
Lable的问题,Label所有constraint删除就不报错,有些其实并不冲突,但是可以全部都删除,然后自动更新,问题就解决了,一晚上都在尝试,希望能帮到你!
NSLayoutConstraint 控制台打印出来几条,就说明有几处有问题。