SDAutoLayout icon indicating copy to clipboard operation
SDAutoLayout copied to clipboard

我Label自适应高度和自适应宽度不起作用

Open xhjss opened this issue 7 years ago • 3 comments
trafficstars

self.titleLabel.sd_layout
.topSpaceToView(self.iconImageView, 14)
.centerXEqualToView(self.iconImageView)
.autoWidthRatio(0)
.autoHeightRatio(0);

xhjss avatar Jun 14 '18 09:06 xhjss

[self.titleLabel setSingleLineAutoResizeWithMaxWidth:100]; 这个再加上试试

liujunliuhong avatar Aug 15 '18 01:08 liujunliuhong

[self.titleLabel setSingleLineAutoResizeWithMaxWidth:100]; 这个再加上试试

那自动设置宽度还有啥用?

bolee avatar Jun 10 '19 07:06 bolee

[self.titleLabel setSingleLineAutoResizeWithMaxWidth:100]; 这个再加上试试

那自动设置宽度还有啥用?

看源码对于宽度自适应的逻辑都是基于maxWidth的if条件里面

pantaopt avatar Nov 19 '19 06:11 pantaopt