NSString *htmlString = @"Header
Subheader
Some text
";
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
textView.attributedText = attributedString;
iOS UITextView UILabel 显示 HTML内容
最新推荐文章于 2021-07-15 20:08:18 发布
本文介绍如何将HTML字符串转换为NSAttributedString,并将其应用于文本视图中,实现HTML内容的显示。
1998

被折叠的 条评论
为什么被折叠?



