无法同时满足约束错误使屏幕在IOS 9中闪烁

时间:2016-10-12 14:20:12

标签: ios nslayoutconstraint

我正在XCode的控制台中跟踪日志。

2016-10-12 16:48:13.218 xx[319:19209] 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:0x16c610c0 H:[JTImageButton:0x16c61120'\Ufffc(null)'(130)]>",
"<NSLayoutConstraint:0x16be02a0 '_UITemporaryLayoutWidth' H:[JTImageButton:0x16c61120'\Ufffc(null)'(1000)]>"
)

Will attempt to recover by breaking constraint 

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.

当这个日志发生时,我的屏幕会闪烁。

我该如何解决?

1 个答案:

答案 0 :(得分:1)

您正在为JTImageButton提供130的水平大小,之后您将定义另一个约束,将水平大小设置为1000.删除其中一个约束。您无法为同一轴定义多个大小约束。