- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode ;
這不是一個特別大得問題, 上面這個方法已經(jīng)報廢了.
請用下面的方法代替.
attributes參數(shù)需要你對NSParagraphStyle類有一定的了解,點我過去
e.g.
UIFont *font = [UIFont systemFontOfSize:16.0f];
CGSize size = CGSizeMake(APPFRAME.size.width - 13.0 * 2, 300);
CGSize labelsize = [content boundingRectWithSize:size
options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
attributes:@{NSFontAttributeName:font}
context:nil].size;