【发布时间】:2019-07-08 05:30:32
【问题描述】:
我有一个表格视图,并在单元格内设置了约束...我遇到了一个我不明白的约束错误。这是控制台打印:
2019-07-08 01:10:56.377538-0400 TableCellDynamicHeight[5827:393085] [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.
(
"<_UILayoutSupportConstraint:0x2835000a0 _UILayoutGuide:0x135e164f0.height == 20 (active)>",
"<_UILayoutSupportConstraint:0x283500000 V:|-(0)-[_UILayoutGuide:0x135e164f0] (active, names: '|':UIView:0x135e16310 )>",
"<NSLayoutConstraint:0x283517e80 V:[_UILayoutGuide:0x135e164f0]-(0)-[UITableView:0x13682e800] (active)>",
"<NSLayoutConstraint:0x2835001e0 V:|-(0)-[UITableView:0x13682e800] (active, names: '|':UIView:0x135e16310 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x283517e80 V:[_UILayoutGuide:0x135e164f0]-(0)-[UITableView:0x13682e800] (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
这就是我的 viewController 和约束的样子:
【问题讨论】:
-
尝试删除 tableview 的 top 约束并再次将其交给 safearea
标签: ios swift uitableview nslayoutconstraint