标签:
UILabel设置行间距:
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:contentLabel.text];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStylealloc]init];
[paragraphStyle setLineSpacing:5];
[attributedString addAttribute:NSParagraphStyleAttributeNamevalue:paragraphStyle range:NSMakeRange(0, contentLabel.text.length)];
contentLabel.attributedText = attributedString;
//调节高度
CGSize size = CGSizeMake(width, MAXFLOAT);
CGSize labelSize = [contentLabel sizeThatFits:size];
标签:
原文地址:http://www.cnblogs.com/Milo-CTO/p/4998269.html