什么原因,为什么这段代码在 IOS7 中不起作用?我正在尝试设置颜色,但颜色不会改变,它保持黑色:
NSDictionary *attributes = [NSDictionary dictionaryWithObject:[UIColor redColor] forKey:NSForegroundColorAttributeName];
NSAttributedString *subString = [[NSAttributedString alloc] initWithString:@"abc" attributes:attributes];
UITextView *textView = ....
textView.attributedText = subString;