当我的 View 正在加载某些东西时会导致延迟并打印此错误 我不知道 请帮忙
2018-05-16 17:07:13.985160+0430 EligashtIOSApp[15125:2090232] [LayoutConstraints] 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:0x119492690 UIButton:0x11bcb9d60'\Ue634'.bottom == UIView:0x11b9be6f0.bottom + 50 (active)>",
"<NSLayoutConstraint:0x11b952d50 UIButton:0x11bcb9d60'\Ue634'.bottom == UIView:0x11b9be6f0.bottom (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x119492690 UIButton:0x11bcb9d60''.bottom == UIView:0x11b9be6f0.bottom + 50 (active)>
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.
最佳答案
您有两个相互冲突的约束。你有一个约束说按钮应该距离 UIView 底部 50 px,还有一个约束说它应该距离同一 View 底部 0 px。这两个不能同时为真,因此您需要删除其中一个。
关于swift - ui加载时自动布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50371206/