1.Label的attributedString属性:
NSAttributedString *attrStr = [[NSAttributedString alloc] initWithData:[h5str dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType} documentAttributes:nilerror:nil];
[selflab setAttributedText:attrStr];
2.利用web view
_webView = [[UIWebView alloc] initWithFrame:CGRectMake(100,100,100,100)];
NSString*html_str = [NSString stringWithFormat:@"666666测试 %@",@"新风作浪",@"2020-01-00"];
[self.webView loadHTMLString:html_str baseURL:nil];
[self.viewaddSubview:self.webView];
```[self.viewaddSubview:self.webView];
网友评论