iPhone X: UITableViewAutomaticDimension not working

问题内容:

I have constraint errors regarding the tableviewcell height only on iPhone X. All other devices have no constraint errors.

(
    "<NSLayoutConstraint:0x60c000297160 UIImageView:0x7fe64585cfe0.height == 33   (active)>",
    "<NSLayoutConstraint:0x60c0002972f0 V:|-(5)-[UIImageView:0x7fe64585cfe0]   (active, names: '|':UITableViewCellContentView:0x7fe64585cdf0 )>",
    "<NSLayoutConstraint:0x60c000297390 V:[UIImageView:0x7fe64585cfe0]-(5.5)-|   (active, names: '|':UITableViewCellContentView:0x7fe64585cdf0 )>",
    "<NSLayoutConstraint:0x60c000297840 'UIView-Encapsulated-Layout-Height' UITableViewCellContentView:0x7fe64585cdf0.height == 43.6667   (active)>"
)

Any idea what might cause this?

Update – I solved it by changing priority of one constraint to 750, but it is unclear why this is causing problems only on iPhone X.

问题评论:

    
Using wtfautolayout it seems there is a conflict between your constraints and the constraint that the table view has added to set its height.

原文地址:

https://stackoverflow.com/questions/47727588/iphone-x-uitableviewautomaticdimension-not-working

添加评论

友情链接:蝴蝶教程