#define kFontName [UIFont systemFontOfSize:20]
NSLog(@"%@",self.status.name);
NSDictionary *nameDic = @{NSFontAttributeName:kFontName};
CGRect nameFrame = [self.status.name boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:nameDic context:nil];
systemFontOfSize是15的时候
self.staus.name 的值为 “内涵段子”
但是在tableviewcell里面显示的是 “内涵..”
systemFontOfSize时20的时候缺能完整显示出来
请问是什么原因
有可能是你不是用的系统字体 你上面的方法是根据系统字体 字体为20 来计算的宽高 如果你不是用的系统的字体 宽高就有可能不精准 检查一下你设置字体的地方 [UIFont systemFontOfSize:20],也是这样设置的么
必须要先指定系统字体大小