【发布时间】:2017-11-29 21:02:39
【问题描述】:
我的布局如下:
Table View (dynamic prototypes, row: automatic height and estimate)
Table View Cell (row height: default)
Content View
Stack View (axis: horizontal, alignment: center, distribution: fill)
Image View (height: 70, width: 70)
Label
UITableView 对其父视图具有所有 4 个约束(顶部、底部、前导和尾随)。 UIStackView 也是如此,相对于它的 superview。
问题是行高不是在界面生成器内部计算的,实际上它指向以下冲突的约束:
bottom = Stack View.bottom
height = 70
Stack View.top = top
centerY = Image View.centerY
我发现这个布局超级简单,我不明白为什么它不起作用。
【问题讨论】:
-
显示实际的“冲突约束”消息。
-
在运行时没有明显的冲突,但是,IB 说有...
-
图像视图的 centerY 约束是什么?
-
它是由 Stack View 强加的,它将其视图与中心对齐,如对齐属性所述。
-
啊 - 抱歉,我没有注意到您的
(row height: default)评论。看我的回答。
标签: ios uitableview interface-builder uistackview