标签:
CGSize constraintSize;
constraintSize.width = MAXFLOAT;
constraintSize.height = 32;
//CGSize sizeFrame =[content.text sizeWithFont:WBLText16Font constrainedToSize:constraintSize lineBreakMode:NSLineBreakByWordWrapping];
//旧的
//新的
NSDictionary *attribute = @{NSFontAttributeName: WBLText16Font};
CGSize sizeFrame = [content.text boundingRectWithSize:CGSizeMake(MAXFLOAT, 0) options: NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:attribute context:nil].size;
iOS7 中 boundingRectWithSize:options:attributes:context:计算文本尺寸的使用
标签:
原文地址:http://www.cnblogs.com/akiraller/p/4934149.html