代码改变世界

随笔档案-2018年06月

CGSize利用sizeWithAttributes 计算文字长度

2018-06-14 15:19 by zhaosn, 849 阅读, 收藏,
摘要: NSString *str =@"abcdefg"; CGSize lblSize = [@"abcdefg" sizeWithAttributes:@{NSFontAttributeName:descriptionLabel.font}]; 此时 lblSize.width的值为str =@"ab 阅读全文