关闭:“无法同时满足约束”[重复]

Posted

技术标签:

【中文标题】关闭:“无法同时满足约束”[重复]【英文标题】:TURN OFF: "Unable to simultaneously satisfy constraints" [duplicate] 【发布时间】:2018-02-06 22:45:00 【问题描述】:

如何关闭此约束冲突日志记录?

最终,我将回到修复项目中的约束。与此同时,由于垃圾邮件中的所有垃圾内容,我无法阅读我的控制台。

我说的是:

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60c00029b120 UIView:0x7fc03fd87c90.centerY == UITableViewCellContentView:0x7fc03fd852a0.centerY   (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.
2018-02-06 16:39:34.094262-0600 Project[12092:1055478] [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:0x60c00029b940 UIView:0x7fc03fd8af60.width == 1   (active)>",
    "<NSLayoutConstraint:0x60c00029bad0 UIView:0x7fc03fd8b140.width == 1   (active)>",
    "<NSLayoutConstraint:0x60c00009e870 UITextField:0x7fc040949600.width == 99   (active)>",
    "<NSLayoutConstraint:0x60c00029bd00 H:|-(114.5)-[UIView:0x7fc03fd8b140]   (active, names: '|':UIView:0x7fc03fd8ad80 )>",
    "<NSLayoutConstraint:0x60c00029bdf0 H:[UIView:0x7fc03fd8b140]-(7.5)-[UITextField:0x7fc040949600]   (active)>",
    "<NSLayoutConstraint:0x60c00029be90 H:[UITextField:0x7fc040949600]-(6.5)-[UIView:0x7fc03fd8af60]   (active)>",
    "<NSLayoutConstraint:0x60c00029bee0 H:[UIView:0x7fc03fd8af60]-(113.5)-|   (active, names: '|':UIView:0x7fc03fd8ad80 )>",
    "<NSLayoutConstraint:0x60c00029c0c0 H:[UIView:0x7fc03fd8ad80]-(16)-|   (active, names: '|':UITableViewCellContentView:0x7fc03fd891d0 )>",
    "<NSLayoutConstraint:0x60c00029c110 UIView:0x7fc03fd8ad80.centerX == UITableViewCellContentView:0x7fc03fd891d0.centerX   (active)>",
    "<NSLayoutConstraint:0x60400028c530 'UIView-Encapsulated-Layout-Width' UITableViewCellContentView:0x7fc03fd891d0.width == 414   (active)>"
)

我桌上的 MacPro 没有这个问题,但我的笔记本电脑有。必须有办法让它停止。我保证有一天我会解决这些限制。请帮忙。谢谢。

【问题讨论】:

【参考方案1】:

我已经有一段时间没有尝试过了,但这曾经有效:

UserDefaults.standard.setValue(false, forKey:"_UIConstraintBasedLayoutLogUnsatisfiable")

【讨论】:

以上是关于关闭:“无法同时满足约束”[重复]的主要内容,如果未能解决你的问题,请参考以下文章

使用代码创建约束 - 出现错误“无法同时满足约束”[重复]

UIAlertController(ActionSheet)-无法同时满足约束[重复]

自动布局无法同时满足约束[重复]

以编程方式应用自动布局约束时无法同时满足约束

自动布局约束:无法同时满足约束

iOS - AutoLayout'无法同时满足约束'