字符串部分变色

2015-07-30  本文已影响0人  JohnDEEEN

NSMutableAttributedString *attriString = [[NSMutableAttributedString alloc] initWithString:desc];

[attriString addAttribute:NSForegroundColorAttributeName

value:[UIColor colorWithRed:126/255.0 green:62/255.0 blue:66/255.0 alpha:1.0]

range:[desc rangeOfString:@"干扰"]];

_skillDescriptionLabel.attributedText=attriString;

上一篇下一篇

猜你喜欢

热点阅读