Heim >Web-Frontend >HTML-Tutorial >利用UILabel、UITextView加载html文本_html/css_WEB-ITnose

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 11:45:301320Durchsuche

挺简单,直接上代码了

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;


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn