Home  >  Article  >  Web Front-end  >  利用UILabel、UITextView加载html文本_html/css_WEB-ITnose

利用UILabel、UITextView加载html文本_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:45:301209browse

挺简单,直接上代码了

NSString *strHtml = @"<b>提示</b><br>1、测试测试测试测试测试测试测试测试测试测试测试测试<br>2、测试测试测试测试测试测试测试测试测试测试";NSAttributedString * strAtt = [[NSAttributedString alloc] initWithData:[strHtml dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];self.labelContent.attributedText = strAtt;self.textViewContent.attributedText = strAtt;


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn