NSMutableAttributedString *bottomStr = [[NSMutableAttributedString alloc]initWithString:_bottomLabel.text];
[bottomStr addAttribute:NSForegroundColorAttributeName value:[UIColor orangeColor] range:NSMakeRange(6, 1)];
_bottomLabel.attributedText = bottomStr;
本文详细介绍了如何使用Objective-C中的NSMutableAttributedString类为特定文本添加高亮效果,包括分配属性、设置颜色以及应用到UILabel实例的过程。通过简单示例展示实现步骤,适合iOS开发者学习。

3341

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



