SDAutoLayout icon indicating copy to clipboard operation
SDAutoLayout copied to clipboard

Label 富文本

Open zhangsaiGitHub opened this issue 7 years ago • 5 comments

我使用的是富文本给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 明显变短

zhangsaiGitHub avatar Dec 27 '17 02:12 zhangsaiGitHub

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

czboosj avatar Dec 27 '17 05:12 czboosj

我没有明白你的意思

zhangsaiGitHub avatar Dec 27 '17 07:12 zhangsaiGitHub

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

zhangsaiGitHub avatar Dec 27 '17 07:12 zhangsaiGitHub

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

czboosj avatar Dec 27 '17 07:12 czboosj

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

bolee avatar Mar 25 '21 03:03 bolee