加载本地HTML文件
2015-12-30 11:23
579 查看
UIWebView*webView = [[UIWebView alloc] initWithFrame:self.view.frame]; NSString*path = [[NSBundle mainBundle] bundlePath]; NSURL*url = [NSURL fileURLWithPath:path]; /*NSString*htmlPath = [[NSBundle mainBundle] pathForResource:@"code.txt" ofType:nil];*/ NSString*htmlPath = [[NSBundle mainBundle] pathForResource:@"help.html" ofType:nil]; NSString*htmlCont = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil]; [webView loadHTMLString:htmlCont baseURL:url]; [self.view addSubview:webView];
相关文章推荐
- ZABBIX封装HTML说明
- HTML 音频/视频 DOM 参考手册
- HTML 颜色名
- HTML 字符集
- HTML ASCII 参考手册
- HTML的form表单自动提交
- HTML DOM方法
- html中的innerHTML
- 个人HTML所有标签总结
- HTML <!DOCTYPE> 标签 布局引用的几种方法 行级元素与块级元素
- 关于html页面布局
- 关于html页面布局
- html 冷门
- sublime texthe 和 Dreamweaver 2015 cc 快速生成html的语法搜集大全
- HTMLayout 和 Sciter
- ActiveX(四) mshtml 命名空间 重要接口简介
- 外行学 html - style
- html有序列表和无序列表
- html网页写一个时钟
- html使用ul li 标签实现多级横向菜单