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 富文本 #258

Open zhangsaiGitHub opened 6 years ago

zhangsaiGitHub commented 6 years ago

我使用的是富文本给Label 负值 。先赋值 后布局 _currentPriceLab.sd_layout .topSpaceToView(_twoNumView, 7 heightRatio1280) .heightIs(23 heightRatio1280) .widthIs(105 widthRatio720) .centerXEqualToView(_twoNumView); _currentPriceLab.backgroundColor = [UIColor blueColor]; 宽度直接写的话是没有问题的 //[_currentPriceLab setSingleLineAutoResizeWithMaxWidth:115 widthRatio720]; 如果这样写就会显示不完 出现省略号 label 明显变短

czboosj commented 6 years ago

我的也是而且开启 富文本布局的参数, 你这个没开启哪个参数 你开了试试

zhangsaiGitHub commented 6 years ago

我没有明白你的意思

zhangsaiGitHub commented 6 years ago

_currentPriceLab.isAttributedContent = YES; 完美解决 方便后来的人看

czboosj commented 6 years ago

isAttributedContent = YES 我的也不行, 就这意思😆, swift 中调用的,

bolee commented 3 years ago

确实有bug,我在有些情况因为设置了富文本,导致位置计算错误