Label设置行高

NSMutableAttributedString *attributedString = [[NSMutableAttributedString   alloc]initWithString:detailLab.text];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
[paragraphStyle setLineSpacing:2];  // 设置行距
[paragraphStyle setHeadIndent:19];  // 缩进
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, detailLab.text.length)];
detailLab.attributedText = attributedString;

你可能感兴趣的:(Label设置行高)