- (CGSize)depaendWithContent:(NSString*)content font:(UIFont*)font withSize:(CGSize)size
{
//返回size
NSMutableParagraphStyle *Style = [[NSMutableParagraphStyle alloc]init];
Style.lineBreakMode = NSLineBreakByWordWrapping;
NSDictionary *attributes1 = @{NSFontAttributeName:font, NSParagraphStyleAttributeName:Style.copy};
CGSize Size = [content boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes1 context:nil].size;
returnSize;
}
网友评论