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

UILabel方法setSingleLineAutoResizeWithMaxWidth 和setIsAttributedContent共同使用会造成设定的高度被修改 #307

Open talka123456 opened 5 years ago

talka123456 commented 5 years ago

code 如下: `self.originLabel.sd_layout .leftSpaceToView(self.priceLabel, 5) .centerYEqualToView(self.priceLabel) .heightIs(20);

[self.originLabel setIsAttributedContent:YES];
[self.originLabel setSingleLineAutoResizeWithMaxWidth:200];`

setIsAttributedContent 和 setSingleLineAutoResizeWithMaxWidth方法共同使用时候,SDAutoLayout库在执行layoutAutoWidthWidthView方法时,会执行[label sizeToFit]方法,导致已经设定的height被修改.有没有其他方式来避免这种问题