gpt4 book ai didi

ios - Project确实还没有像样的约束,为什么每次都给我这个约束警告?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:09:08 24 4
gpt4 key购买 nike

每次我运行我的项目时,我都会在控制台中收到此警告:

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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "<_UIScrollViewAutomaticContentSizeConstraint:0x8cc6830 UITableView:0xb3f5c00.contentHeight{id: 112} == -7.000000>" )

Will attempt to recover by breaking constraint <_UIScrollViewAutomaticContentSizeConstraint:0x8cc6830 UITableView:0xb3f5c00.contentHeight{id: 112} == -7.000000>

Break on objc_exception_throw to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful.

它来自 UITableView,我绝对没有直接接触 UIScrollView。它在具有以下约束的每个单元格中只有一个标签:

enter image description here

我用谷歌搜索了又用谷歌搜索,但找不到任何东西。有谁知道它为什么提示 UIScrollView?

最佳答案

如果你想删除警告,最快的方法是在 Storyboard中。 add / remove constraints

选择导致显示警告的 View Controller 并选择:clear all constrains in yourViewControllersName。

另一个选项是选择:重置为您的 ViewControllersName 中建议的约束。

这些操作将清除所有约束,或者将 Xcode 认为最合适的约束添加到 View Controller 。

依赖于建议的约束有时会(或者总是这样?)添加不符合您需求的约束..

关于ios - Project确实还没有像样的约束,为什么每次都给我这个约束警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20387050/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com