We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97b019e commit 5746c1bCopy full SHA for 5746c1b
QMUIKit/QMUIComponents/QMUILabel.m
@@ -52,7 +52,7 @@ - (CGSize)intrinsicContentSize {
52
53
- (void)layoutSubviews {
54
[super layoutSubviews];
55
- if (self.truncatingTailView) {
+ if (self.truncatingTailView && self.attributedText.length) {
56
[self bringSubviewToFront:self.truncatingTailView];
57
58
// 不能通过修改 numberOfLines = 0 再恢复它的值,来计算高度是否折叠了,因为修改它的值会触发 layout,从而陷入死循环,所以这里只能通过 NSAttributedString 来计算内容的实际高度。注意如果 lineBreakMode 为 Tail 的话,NSAttributedString 必定只能计算单行的高度,所以要手动改为非 Tail 的值
0 commit comments