Masonry icon indicating copy to clipboard operation
Masonry copied to clipboard

iOS 10.3 :cell can not correctly calculate height

Open jiangjunwy opened this issue 9 years ago • 7 comments

Issue Description

In iOS 10.3,The following code is unable to correctly calculate height,

wechatimg1

[_titleLabel mas_makeConstraints:^(MASConstraintMaker *make){ make.top.equalTo(cell.contentView.mas_top); make.left.equalTo(cell.contentView.mas_left).offset(20.0); make.right.equalTo(cell.contentView.mas_right).offset(-20.0); make.bottom.equalTo(cell.contentView.mas_bottom).offset(-20.0); }];

Add the following code, however, can correctly calculate the height

wechatimg2

[cell.contentView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(cell); }]; [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make){ make.top.equalTo(cell.contentView.mas_top); make.left.equalTo(cell.contentView.mas_left).offset(20.0); make.right.equalTo(cell.contentView.mas_right).offset(-20.0); make.bottom.equalTo(cell.contentView.mas_bottom).offset(-20.0); }];

And,Masonry can correctly calculate the cell height before iOS 10.3

jiangjunwy avatar Mar 24 '17 08:03 jiangjunwy

+1

KenmuHuang avatar Mar 27 '17 07:03 KenmuHuang

We hope that Masonry can correctly calculate height in iOS 10.3, thx. @cloudkite @robertjpayne

KenmuHuang avatar Mar 27 '17 08:03 KenmuHuang

This problem also happened in my application.

LynahZ avatar Mar 28 '17 10:03 LynahZ

+1

zb737472783 avatar Mar 29 '17 02:03 zb737472783

+1

mugiwarach avatar Mar 29 '17 04:03 mugiwarach

+1

HaishengLiang avatar Mar 29 '17 08:03 HaishengLiang

_titleLabel.preferredMaxLayoutWidth = [UIScreen mainScreen].bounds.size.width - 40; fix it

htxian avatar Mar 29 '17 09:03 htxian