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];