iOS修改行间距

NSString*labelText = cell.descLabel.text;

NSMutableAttributedString*attributedString = [[NSMutableAttributedStringalloc]initWithString:labelText];

NSMutableParagraphStyle*paragraphStyle = [[NSMutableParagraphStylealloc]init];

[paragraphStylesetLineSpacing:5.0];

[attributedStringaddAttribute:NSParagraphStyleAttributeNamevalue:paragraphStylerange:NSMakeRange(0, [labelTextlength])];

cell.descLabel.attributedText= attributedString;

[cell.descLabelsizeToFit];

你可能感兴趣的:(iOS修改行间距)