- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode ;

- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode ;

上面这个方法已经报废了.

请用下面的方法代替.

attributes参数需要你对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;

你可能感兴趣的:(- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode ;)