UILabel 设置行间距

NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:testString]; 
NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init]; 
[paragraphStyle1 setLineSpacing:15]; 
[attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [testString length])]; 
[cLabel setAttributedText:attributedString1]; 
[cLabel sizeToFit];


你可能感兴趣的:(UILabel 设置行间距)