Home > Web Front-end > HTML Tutorial > Use UILabel and UITextView to load html text_html/css_WEB-ITnose

Use UILabel and UITextView to load html text_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:45:30
Original
1259 people have browsed it

It’s very simple, just start coding

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;
Copy after login


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template