【问题标题】:Warnings while using NSLayoutConstraints使用 NSLayoutConstraints 时的警告
【发布时间】:2023-03-12 12:08:01
【问题描述】:

由于我是 AutoLayout Constraints 的新手,当我使用约束添加了一些 UI 元素时,我面临一些与 tableview 单元格内容视图相关的警告。我在控制台中发现的警告是

无法同时满足约束。 以下列表中的至少一个约束可能是您不想要的。 试试这个: (1)查看每个约束并尝试找出您不期望的; (2) 找到添加了一个或多个不需要的约束的代码并修复它。 ( "", "", "", “” )

将尝试通过打破约束来恢复

谁能解释一下警告和解决方案?

【问题讨论】:

  • 警告是“<0x7f85dbe84490 h:><0x7f85dbe84f00 h:><0x7f85dbe84f50 h:><0x7f85dbe encapsulated-layout-width h:><0x7f85dbe84490 h:>

标签: ios iphone constraints nslayoutconstraint ios-autolayout


【解决方案1】:

发布有用的链接。

Apple 的详细指南如何理解、调试和修复自动布局警告。

Auto Layout Guide: Debugging Tricks and Tips

可视化冲突约束的工具。

WTF Auto Layout

【讨论】:

    猜你喜欢
    • 2019-05-06
    • 1970-01-01
    • 1970-01-01
    • 2017-03-23
    • 2017-11-19
    • 2012-12-14
    • 2017-05-05
    • 2016-09-02
    • 2013-12-05
    相关资源
    最近更新 更多