UILabel设置行间距:
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:contentLabel.text]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStylealloc]init]; [paragraphStyle setLineSpacing:]; [attributedString addAttribute:NSParagraphStyleAttributeNamevalue:paragraphStyle range:NSMakeRange(, contentLabel.text.length)]; contentLabel.attributedText = attributedString; //调节高度
CGSize size = CGSizeMake(width, MAXFLOAT); CGSize labelSize = [contentLabel sizeThatFits:size];