我如何建议TableViewCell高度为零?

时间:2018-01-16 13:08:29

标签: nslayoutconstraint xcode9

我有一个带有一些静态单元格的tableView。它设置为自动计算行高。最底部的按钮位于具有高度约束以及顶部,底部,前导和尾随的单元格中。所有约束都在界面构建器中完成,没有显示场景的警告或错误。

Button Placement

然而,当我运行应用程序并显示场景时,我收到此警告:

2018-01-16 08:00:40.149994-0500 Reference App[9176:1864272] [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:0x7fd01dd16530 UIButton:0x7fd01dd171a0'Reset Data'.height == 44   (active)>",
    "<NSLayoutConstraint:0x7fd01dd31860 V:|-(0)-[UIButton:0x7fd01dd171a0'Reset Data']   (active, names: '|':UITableViewCellContentView:0x7fd01dd314c0 )>",
    "<NSLayoutConstraint:0x7fd01dd31bb0 V:[UIButton:0x7fd01dd171a0'Reset Data']-(0)-|   (active, names: '|':UITableViewCellContentView:0x7fd01dd314c0 )>",
    "<NSLayoutConstraint:0x7fd01d8516c0 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7fd01dd314c0.height == 44   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7fd01dd16530 UIButton:0x7fd01dd171a0'Reset Data'.height == 44   (active)>

我不明白为什么我会收到错误。正如在此链接What is NSLayoutConstraint "UIView-Encapsulated-Layout-Height" and how should I go about forcing it to recalculate cleanly?中所建议的那样,我尝试将高度约束的优先级降低到999并且它没有解决问题。我还给出了估计高度44,它将输出减少到只有零高度的警告。

我做错了什么?

0 个答案:

没有答案
相关问题