//获取高度
-(CGFloat)getStrHeight:(NSString *)string withFont:(CGFloat)font withWidth:(NSInteger)width
{
NSDictionary *attr=@{NSFontAttributeName:[UIFont systemFontOfSize:font]};
CGSize sizeHeigth = [string boundingRectWithSize:CGSizeMake(width, 100000) options:NSStringDrawingUsesLineFragmentOrigin attributes:attr context:nil].size;
return sizeHeigth.height;
}
//获取宽度
-(CGFloat)getStrWidth:(NSString *)string withFont:(CGFloat)font
{
CGSize size = [string sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:font]}];
return size.width;
}