获得uialbel的自适应大小方法:
text 为文字,
- (CGSize)textSizeWith:(NSString *)text andMaxWidth:(float)maxWidth and:(int)font{
CGSize textMaxSize = CGSizeMake(maxWidth, MAXFLOAT);
NSDictionary *textArr = @{NSFontAttributeName:[UIFont systemFontOfSize:font]};
return [text boundingRectWithSize:textMaxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:textArr context:nil].size;
}