SDAutoLayout icon indicating copy to clipboard operation
SDAutoLayout copied to clipboard

label放英文时出现细线

Open yuhangjob opened this issue 8 years ago • 4 comments

2017-08-28 2 09 16

label放英文时出现细线

yuhangjob avatar Aug 28 '17 06:08 yuhangjob

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

yuhangjob avatar Aug 28 '17 06:08 yuhangjob

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

whgt1989 avatar Sep 06 '17 18:09 whgt1989

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

yuhangjob avatar Sep 07 '17 02:09 yuhangjob

根据文本自动算高好像是有这个问题,我修改了向上取整没问题了 2018-09-16 10 39 54

AllenYL avatar Sep 16 '18 02:09 AllenYL