我从服务器收到以下文本。
"<span class='quill-mention' data-name='@Saurabh Shah
(5327)' data-id='859155' user-id='859155'>@Saurabh Shah
(5327)</span> Test";
我想让它像@Saurabh Shah
测试
使用@Saurabh Shah
蓝色字体。
目前我正在使用以下代码:
NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc] initWithData:
[self.message dataUsingEncoding:NSUTF8StringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: [NSNumber numberWithInt:NSUTF8StringEncoding]} documentAttributes:nil error:nil];
这给了我字符串:@Saurabh Shah
测试。但不是蓝色。
我该怎么做?