//自适应计算间距
- ( void )resetContent{
NSMutableAttributedString *attributedString = [[ NSMutableAttributedString alloc ]initWithString : self . contentLabel . text ];
NSMutableParagraphStyle *paragraphStyle = [[ NSMutableParagraphStyle alloc ] init ];
paragraphStyle. alignment = NSTextAlignmentLeft ;
paragraphStyle. maximumLineHeight = 60 ; //最大的行高
paragraphStyle. lineSpacing = 5 ; //行自定义行高度
[paragraphStyle setFirstLineHeadIndent : self . usernameLabel . frame . size . width + 5 ]; //首行缩进 根据用户昵称宽度在加5个像素
[attributedString addAttribute : NSParagraphStyleAttributeName value :paragraphStyle range : NSMakeRange ( 0 , [ self . contentLabel . text length ])];
self . contentLabel . attributedText = attributedString;
[ self . contentLabel sizeToFit ];// 可以去掉
}