开发过程中遇到约束冲突的报错:
2021-01-23 15:35:00.036312+0800 WisdomChain[1057:512850] [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:0x283c4c910 UIView:0x111e168f0.width == - 16 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x283c4c910 UIView:0x111e168f0.width == - 16 (active)>
1.先点击Debug View Hierarchy
2.打印页控件层级和地址
Obj-C project
po [[UIWindow keyWindow] _autolayoutTrace]
Swift project
expr -l objc++ -O -- [[UIWindow keyWindow] _autolayoutTrace]