Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 10.3 :cell can not correctly calculate height #426

Open
jiangjunwy opened this issue Mar 24, 2017 · 7 comments
Open

iOS 10.3 :cell can not correctly calculate height #426

jiangjunwy opened this issue Mar 24, 2017 · 7 comments

Comments

@jiangjunwy
Copy link

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

@KenmuHuang
Copy link

+1

@KenmuHuang
Copy link

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

@LynahZ
Copy link

LynahZ commented Mar 28, 2017

This problem also happened in my application.

@zb737472783
Copy link

+1

2 similar comments
@mugiwarach
Copy link

+1

@HaishengLiang
Copy link

HaishengLiang commented Mar 29, 2017

+1

@htxian
Copy link

htxian commented Mar 29, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants