開發(fā)過程中遇到約束沖突的報(bào)錯(cuò):
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.先點(diǎn)擊Debug View Hierarchy
2.打印頁控件層級(jí)和地址
Obj-C project
po [[UIWindow keyWindow] _autolayoutTrace]
Swift project
expr -l objc++ -O -- [[UIWindow keyWindow] _autolayoutTrace]