UILabel *contentLab = (UILabel *)[suizhenView viewWithTag:702]; contentLab.numberOfLines = 0; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:contentLab.text]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; [paragraphStyle setLineSpacing:8];//调整行间距 [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [contentLab.text length])]; contentLab.attributedText = attributedString; [contentLab sizeToFit];
转载于:https://my.oschina.net/u/2258005/blog/336672