我正在做Facebook这样的标记功能,并且我已经可以标记用户了。我可以像这样展示。它由这个代码完成。NSMutableAttributedString知道哪些文本的颜色被改变
NSMutableAttributedString * string = [[NSMutableAttributedString alloc]initWithString:self.textView.text];
for (NSString *word in self.tagNameCollection) {
[string addColor:[UIColor redColor] substring:word];
[string addBackgroundColor:[Helpers getFromRGB:135 green:206 blue:250] substring:word];
}
所以,我有NSMutableAttributedString。我可以知道我在哪里更改颜色,从我的NSMutableAttributedString字体?我可以知道该怎么办?
Lookt在'enumerateAttributesInRange:选择:usingBlock:' – Larme 2015-03-02 08:52:38