1. UILabel根据内容,得到合适的宽高
+ (CGRect)LabelCount:(NSString *)mstr FontSize:(NSInteger)size
{
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[UIFont systemFontOfSize:size], NSFontAttributeName,
[UIColor darkTextColor], NSForegroundColorAttributeName,nil];
NSStringDrawingContext *dcontext = [[NSStringDrawingContext alloc] init];
CGRect contentRect = [mstr boundingRectWithSize:CGSizeMake(kWidth, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:dcontext];
return contentRect;
}