【发布时间】:2017-11-07 05:41:47
【问题描述】:
当我的 UITableViewCell 行显示时,它们的高度为 44。他们绝对不应该这样做。正如您在下面有关不良约束的警告中看到的那样,我已经限制了路径的整个从上到下。
忽略它不喜欢我的 $ballIsSquare$ 高度/宽度约束的事实,我仍然应该有一个高度超过 44 的单元格。它显示几乎是圆形的球,这意味着高度几乎是 55 高(因为它显示 $ballWidth$ 为 55。但是,它根本没有显示日期标签,日期标签被限制在球上方。知道单元格是什么被逼这么小?
视图控制器为此指定估计的行高 100,并且 rowHeight 设置为 UITableViewAutomaticDimension。
我认为“UISV-alignment”和 UISV-canvas-connection 是来自正在使用的 UIStackView 的约束(例如,$ballsBottom$ 指的是球 UIStackView)
UIView-Encapsulated-Layout-Height 在我看来是真正的问题。
"<NSLayoutConstraint:0x60400008d070 '$ballIsSquare$' DidIWin.BallView:0x7f8525a3fec0.height == DidIWin.BallView:0x7f8525a3fec0.width (active)>",
"<NSLayoutConstraint:0x604000091ad0 '$ballsBottom$' DidIWin.Balls:0x7f8525a3e890.bottom == UILayoutGuide:0x6040001a6c80'UIViewSafeAreaLayoutGuide'.bottom - 10 (active)>",
"<NSLayoutConstraint:0x604000086c70 '$ballWidth$' DidIWin.BallView:0x7f8525a3fec0.width == 55 (active)>",
"<NSLayoutConstraint:0x6040000928e0 '$largeDateBottom$' UILabel:0x7f8525a44510'10/4/17'.bottom == DidIWin.Balls:0x7f8525a3e890.top + 10 (active)>",
"<NSLayoutConstraint:0x604000092840 '$largeDateTop$' UILabel:0x7f8525a44510'10/4/17'.top == UILayoutGuide:0x6040001a6c80'UIViewSafeAreaLayoutGuide'.top + 10 (active)>",
"<NSLayoutConstraint:0x604000092020 'UISV-alignment' DidIWin.BallView:0x7f8525a3ead0.bottom == DidIWin.BallView:0x7f8525a3fec0.bottom (active)>",
"<NSLayoutConstraint:0x604000091f30 'UISV-alignment' DidIWin.BallView:0x7f8525a3ead0.top == DidIWin.BallView:0x7f8525a3fec0.top (active)>",
"<NSLayoutConstraint:0x60400008c670 'UISV-canvas-connection' DidIWin.Balls:0x7f8525a3e890.top == DidIWin.BallView:0x7f8525a3ead0.top (active)>",
"<NSLayoutConstraint:0x604000091c60 'UISV-canvas-connection' V:[DidIWin.BallView:0x7f8525a3ead0]-(0)-| (active, names: '|':DidIWin.Balls:0x7f8525a3e890 )>",
"<NSLayoutConstraint:0x604000091da0 'UIView-Encapsulated-Layout-Height' DidIWin.FailureDetailCell:0x7f8526047200'failure'.height == 44 (active)>",
"<NSLayoutConstraint:0x604000091940 'UIViewSafeAreaLayoutGuide-bottom' V:[UILayoutGuide:0x6040001a6c80'UIViewSafeAreaLayoutGuide']-(0)-| (active, names: '|':DidIWin.FailureDetailCell:0x7f8526047200'failure' )>",
"<NSLayoutConstraint:0x6040000918a0 'UIViewSafeAreaLayoutGuide-top' V:|-(0)-[UILayoutGuide:0x6040001a6c80'UIViewSafeAreaLayoutGuide'] (active, names: '|':DidIWin.FailureDetailCell:0x7f8526047200'failure' )>"
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60400008d070 '$ballIsSquare$' DidIWin.BallView:0x7f8525a3fec0.height == DidIWin.BallView:0x7f8525a3fec0.width (active)>
【问题讨论】:
标签: xcode interface-builder xcode9