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;
时间: 2024-10-18 09:13:16