It has the same height between iOS13 Or iOS 14 with the same words in the label . But It's different from when I use the CoreText .For example:
click the UIlabel and obtain the last line bounds with CoreText is different
NSMutableAttributedString *attri = [[NSMutableAttributedString alloc]initWithString:@"107年前(743年),世界上突然出现了人类的天敌“巨人”。面临着生存危机而残存下来的。107年前(743年),世界上突然出现了人类的天敌“巨人”。面临着生存危机而残存下来的。107年前(743年),世界上突然出现了人类的天敌“巨人”。面临着生存危机而残存下来的。107年前(743年),世界上突然出现了人类的天敌“巨人”。面临着生存危机而残存下来的。];
[attri addAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16]} range:NSMakeRange(0, attri.length)];
NSMutableParagraphStyle *paraStyle = [NSMutableParagraphStyle new];
paraStyle.lineSpacing = 4;
[attri addAttribute:NSParagraphStyleAttributeName value:paraStyle range:NSMakeRange(0, attri.length)];
In iOS 13 or iOS 14 The UIlabel Bounds is CGRect(0 0; 232 250.5)
But
the result of Coretext obtain the LastLine Height In iOS13 is (CGRect) lineBounds = (origin = (x = 0, y = 212.24000000000001), size = (width = 114.23999999999998, height = 16));
the result of Coretext LastLine Height In iOS14 is (CGRect) lineBounds = (origin = (x = 0, y = 231.24000000000001), size = (width = 114.23999999999998, height = 16));
why it's different betweeen iOS 13 and iOS14 about the point.y
question from:
https://stackoverflow.com/questions/66057278/why-does-calculate-text-bounds-is-different-between-uilabel-and-coretext 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…