gsdios / SDAutoLayout

One line of code to implement automatic layout. 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based on runtime.
MIT License
5.9k stars 1.28k forks source link

label放英文时出现细线 #221

Open yuhangjob opened 7 years ago

yuhangjob commented 7 years ago

2017-08-28 2 09 16

label放英文时出现细线

yuhangjob commented 7 years ago

6195e6ec-3812-454f-94a8-c9b9a50a6fca 我设置了 label的高度自适应就会出现这种问题 改为固定高度就不会

whgt1989 commented 7 years ago

原因:如果宽、高是精度很高的小数,view显示的时候都会有黑线。将宽高设为整数值就好了。 contentLabel.sd_resetLayout .topSpaceToView(topView,0) .leftEqualToView(topView) .widthIs((int)(textRect.size.width + 1)) .heightIs((int)(textRect.size.height + 1));

yuhangjob commented 7 years ago

能请教一下 textRect 是怎么来的么?

AllenYL commented 6 years ago

根据文本自动算高好像是有这个问题,我修改了向上取整没问题了

2018-09-16 10 39 54