/**
调整label.text字体间距
*/
- (void)changeHeightOfLabelLineWithContentLabel:(UILabel*)contentLabel
{
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:contentLabel.text];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
[paragraphStyle setLineSpacing:5];
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, contentLabel.text.length)];
contentLabel.attributedText = attributedString;
//调节高度
CGSize size = CGSizeMake(contentLabel.frame.size.width, 500000);
[contentLabel sizeThatFits:size];
调整label.text字体间距
*/
- (void)changeHeightOfLabelLineWithContentLabel:(UILabel*)contentLabel
{
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:contentLabel.text];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
[paragraphStyle setLineSpacing:5];
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, contentLabel.text.length)];
contentLabel.attributedText = attributedString;
//调节高度
CGSize size = CGSizeMake(contentLabel.frame.size.width, 500000);
[contentLabel sizeThatFits:size];
}