我正在寻找我的文本视图中的所有文本都是灰色的,然后第一句话是黑色的。如何将该范围设置为黑色。我已经有了第一句字符串/范围。谢谢你。
[tv setTextColor:[UIColor grayColor]];
id<UITextInputTokenizer> tokenizer = tv.tokenizer;
UITextRange *range = [tokenizer rangeEnclosingPosition:tv.beginningOfDocument
withGranularity:UITextGranularitySentence
inDirection:UITextStorageDirectionForward];
NSString *firstSentence = [tv textInRange:range];
NSLog(@"%@",firstSentence);