- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
每次我运行我的项目时,我都会在控制台中收到此警告:
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。它在具有以下约束的每个单元格中只有一个标签:
我用谷歌搜索了又用谷歌搜索,但找不到任何东西。有谁知道它为什么提示 UIScrollView?
最佳答案
如果你想删除警告,最快的方法是在 Storyboard中。
选择导致显示警告的 View Controller 并选择:clear all constrains in yourViewControllersName。
另一个选项是选择:重置为您的 ViewControllersName 中建议的约束。
这些操作将清除所有约束,或者将 Xcode 认为最合适的约束添加到 View Controller 。
依赖于建议的约束有时会(或者总是这样?)添加不符合您需求的约束..
关于ios - Project确实还没有像样的约束,为什么每次都给我这个约束警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20387050/
我是一名优秀的程序员,十分优秀!