SDAutoLayout
SDAutoLayout copied to clipboard
我Label自适应高度和自适应宽度不起作用
trafficstars
self.titleLabel.sd_layout
.topSpaceToView(self.iconImageView, 14)
.centerXEqualToView(self.iconImageView)
.autoWidthRatio(0)
.autoHeightRatio(0);
[self.titleLabel setSingleLineAutoResizeWithMaxWidth:100]; 这个再加上试试
[self.titleLabel setSingleLineAutoResizeWithMaxWidth:100]; 这个再加上试试
那自动设置宽度还有啥用?
[self.titleLabel setSingleLineAutoResizeWithMaxWidth:100]; 这个再加上试试
那自动设置宽度还有啥用?
看源码对于宽度自适应的逻辑都是基于maxWidth的if条件里面