NSMutableAttributedString *attriStr = [[NSMutableAttributedString alloc] initWithString:str];
[attriStr addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(str.length-1,1)];
[attriStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(str.length-1,1)];
cell.price.attributedText = attriStr;转载于:https://www.cnblogs.com/zzzili/p/6662478.html
本文详细介绍了如何在iOS应用中使用NSAttributedString来设置文本颜色和字体大小,并通过代码示例展示了如何将高亮效果应用于特定文本片段。
2503

被折叠的 条评论
为什么被折叠?



