=》NSString
1. 计算字符串的显示长度
NSInteger strSize = [str sizeWithFont:[UIFont boldSystemFontOfSize:12]];
同时NSString还提供了其它类似的sizeWithFont来计算长度。
2. 显示百分数
[NSString stringWithFormat:@"%d%%", 20];
使用%%,则可以显示百分号,如是显示为20%
=》NSString
1. 计算字符串的显示长度
NSInteger strSize = [str sizeWithFont:[UIFont boldSystemFontOfSize:12]];
同时NSString还提供了其它类似的sizeWithFont来计算长度。
2. 显示百分数
[NSString stringWithFormat:@"%d%%", 20];
使用%%,则可以显示百分号,如是显示为20%