这是一个加号方法,计算文本的高度
+(CGSize)textStr:(NSString*)text andFont:(NSInteger)fontSize andSize:(CGSize)size
{
CGSize sizeText;
sizeText=[text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:fontSize],NSForegroundColorAttributeName:[UIColor blackColor]} context:nil].size;
return sizeText;
}