//计算每一行文本的高度
+(CGFloat)getTextHeightString:(NSString*)text ForWidth:(CGFloat)width font:(float)font
{
CGSize size = [text boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:(NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesFontLeading |NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:font]} context:nil].size;
return size.height;
}
网友评论