码迷,mamicode.com
首页 > Web开发 > 详细

利用UILabel、UITextView加载html文本

时间:2015-04-27 13:23:58      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:uilabel   uitextview   html   label   nsattributedstring   

挺简单,直接上代码了

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;


利用UILabel、UITextView加载html文本

标签:uilabel   uitextview   html   label   nsattributedstring   

原文地址:http://blog.csdn.net/u011439689/article/details/45307625

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!