在UILable内显示HTML页面内容
2015-09-23 09:09
381 查看
注意:这个方法只支持IOS7以上
NSString * htmlString = @"html文本内容"; NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil]; UILabel * myLabel = [[UILabel alloc] initWithFrame:self.view.bounds]; myLabel.attributedText = attrStr; [self.view addSubview:myLabel];
相关文章推荐
- SuiShenJi项目_登录界面
- AlertDialog.Builder
- UIScrollview UIPageViewCon troller
- UI高级第三课  音频视频——iOS学习连载31
- 张瀚荣:如何用UE4制作3D动作游戏
- Nicholas谈UE4高级渲染:动态光照迭代快
- Nicholas谈UE4对手游平台的优化和支持
- UE4手册中文翻译速查表
- Repeated DNA Sequences
- iOS-Core-Animation-Advanced-Techniques(五)
- Customizing Your Build With Gradle
- Android面试题 请解释下单线程模型中Message、Handler、MessageQueue、Looper之间的关系
- 【UIKit-124-3】#import <UIKit/UIView.h>
- codechef Tree and Queries Solved
- iOS-Core-Animation-Advanced-Techniques(一)
- Vollery 框架之StringRequest二次封装
- iOS开发之有趣的UI —— 抽屉特效
- PHP 性能分析第二篇: Xhgui In-Depth
- PHP 性能分析第二篇: Xhgui In-Depth
- requestFeature() must be called before adding content