为什么80%的码农都做不了架构师?>>>
//设置lab的行间距
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:_doubletStr];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:10];//调整行间距
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, _doubletStr.length)];
_resultLab.attributedText = attributedString;
//计算label带行间距的行高
CGFloat labelHeight = [_resultLab sizeThatFits:CGSizeMake(_resultLab.frame.size.width, MAXFLOAT)].height;
//label有多少行
NSNumber *count = @((labelHeight) / _resultLab.font.lineHeight);
NSLog(@"共 %td 行", [count integerValue]);