ios - 自动布局无法满足看似不冲突的约束
问题描述
我已将UIView
80x80 的自定义放入UITableViewCell
具有以下约束的自定义中。
的Content View为 80 高,而Safe Area & 整体UITableViewCell
为 80.5 高,大概是为了说明单元格之间的界限。Xcode 在构建过程中不会抱怨。我没有在应用程序的其他地方设置任何其他硬编码约束。
然而在运行时,这些似乎冲突,尽管看起来似乎不正确:
[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:0x283f60190 WindDirectionIndicator:0x104f32ac0.height == 80 (active)>",
"<NSLayoutConstraint:0x283f60230 V:[WindDirectionIndicator:0x104f32ac0]-(0)-| (active, names: '|':UITableViewCellContentView:0x104f326d0 )>",
"<NSLayoutConstraint:0x283f60280 V:|-(0)-[WindDirectionIndicator:0x104f32ac0] (active, names: '|':UITableViewCellContentView:0x104f326d0 )>",
"<NSLayoutConstraint:0x283f60550 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x104f326d0.height == 80 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x283f60190 WindDirectionIndicator:0x104f32ac0.height == 80 (active)>
似乎同意边界放置在顶部和底部,并且单元格和 UIView 都是 80 高。我在这里想念什么?
解决方案
推荐阅读
- c# - 如何在 .NET Core 中获取机器配置文件名
- typescript - 打字稿 TSC 错误:下划线/索引 x"' 没有导出的成员 '_'
- java - 如何隔离集成测试?
- python - 打印所有三或五的倍数的数字的总和的逻辑错误
- python - Maya 通过 python 烘焙枢轴
- javascript - 使用 Wordpress 时,在 chrome 中悬停时消失元素
- c# - SQL Server 上的 AES 解密
- javascript - Bootstrapvalidator 更新状态为无效在活动字段上仍然有效
- google-sheets - 对 Parkrun 数据使用 IMPORTHTML 并返回 N/A
- python - 如何更改 tkinter 输入字段的宽度或高度