```
+ (CGFloat)heighForText:(NSString *)string{
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:string];
NSRange allRange = [string rangeOfString:string];
[attrStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14.0] range:allRange];
[attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor darkGrayColor]range:allRange];
CGFloat titleHeight;
NSStringDrawingOptions options = NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading;
//获取label的最大宽度
CGRect rect = [attrStr boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width - 30, CGFLOAT_MAX)options:options context:nil];
titleHeight = ceilf(rect.size.height);
return titleHeight;
}
```