UITextView,Label加载html代码

来源:互联网 发布:appstore无法下载软件 编辑:程序博客网 时间:2024/05/22 07:58
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil]; self.textView.attributedText = attributedString; self.label.attributedText = attributedString;
0 0
原创粉丝点击