为什么这个不起作用?无论字符串的长度如何,它总是返回18。有这个主题,但没有明确的答案。
NSString * t = @"<insert super super long string here>";
CGSize size = [t sizeWithFont:[UIFont systemFontOfSize:14.0] forWidth:285 lineBreakMode:UILineBreakModeWordWrap];
NSLog(@"size.height is %f and text is %@", size.height, t);
谢谢,
Todd