标签:span tle eof 开发 ring 技术 字符串 name value
改变指定位置字符的颜色,代码如下:
NSString *descStr = @"楼主"; NSString *nickStr = [NSString stringWithFormat:@"小仙女%@",descStr]; NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc]initWithString:descStr]; [attrStr addAttribute:NSForegroundColorAttributeName value:MainColor range:[nickStr rangeOfString:descStr]]; self.TopUserInfoV.titleLabs.attributedText = attrStr;
如下图红框:
标签:span tle eof 开发 ring 技术 字符串 name value
原文地址:http://www.cnblogs.com/hero11223/p/7911226.html