-
Notifications
You must be signed in to change notification settings - Fork 2k
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
10.3 自适应不行了 #289
Comments
这是自适应失效了? |
+1,希望能自适应处理好 10.3 系统下使用 Masonry 约束的高度计算 |
Same problem here... |
I found the problem... It looks like for some UILabel, a preferredMaxLayoutWidth is configured, mainly when they are created using the Storyboard/NIB file. And the problem is that the value available at the time that the Cell is created is the one it had on the Storyboard... Setting all the label's preferredMaxLayoutWidth to 0 fixed the problem for me, i.e.:
|
Or even better:
|
暂时给contentView加上了上下左右的约束 10.3在调用systemLayoutSizeFittingSize的时候会多添加几条width和height的约束,导致约束冲突 |
我现在的解决办法是在 |
归根结底还是得设置 |
问题: 项目中使用 XIB 布局, 单个 cell 对应 单个view, 第一次打开带 多行 label 的 cell 时, 布局正常. 再打开其他的带多行 label的 cell 时, 自动布局失效,即行高计算错误.
lineBreakMode 枚举中, 选择前三个任意一个, 布局正常. |
10.3 使用 |
纯代码项目中,使用Masonry和FD自适应cell高度,也出现一样的问题,这种情况应该怎么解决呢,每个cell都对应设置一下 |
重新约束contentView |
楼主看到你的帖子,我赶紧看了一下我的界面,iOS10.3没有发现问题呀,好多人都说设置preferredMaxLayoutWidth, 我也没设置过呀,不知道你的问题出在哪里???我也是用的纯代码+ Masonry |
@taogeyijiu 用nib布局会出问题 |
+1 |
设置多行label的preferredMaxLayoutWidth就好啦 |
结论: 多行label的preferredMaxLayoutWidth的问题 |
I resolve this use a estimatedRowHeight and set a value not zero. It is very helpful. |
thank you |
No description provided.
The text was updated successfully, but these errors were encountered: