Xcode运行HTML5代码
2016-07-13 10:07
369 查看
@property(nonatomic,strong)UIWebView *webView;
self.webView = [[UIWebView alloc]init];
_webView.frame = self.view.bounds;
self.webView.delegate = self;
[self.view addSubview:_webView];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
NSString *fileContent = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
[self.webView loadHTMLString:fileContent baseURL:[NSURL URLWithString:filePath]];
self.webView = [[UIWebView alloc]init];
_webView.frame = self.view.bounds;
self.webView.delegate = self;
[self.view addSubview:_webView];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
NSString *fileContent = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
[self.webView loadHTMLString:fileContent baseURL:[NSURL URLWithString:filePath]];
相关文章推荐
- H5中的地图定位
- 基于 HTML5 的 WebGL 技术构建 3D 场景(一)
- 基于 HTML5 的 WebGL 技术构建 3D 场景(一)
- Html5 CSS设置背景图片
- 多媒体
- canvas 渐变(很全面,很实用)
- HTML5和CSS3动画效果知识点总结
- html5 index
- HTML5基础学习笔记(六)
- 深入研究z-index
- HTML5+和MUI页面操作
- html5基础知识
- OC和H5交互
- H5页面之iphone6的适配
- Audio
- html5解决大文件断点续传
- WebSocket 网页聊天室的实现(服务器端:.net + windows服务,前端:Html5)
- swipe的基础使用(二十三)
- 面向移动设备的HTML5开发框架
- swiper教程--swiper的基础使用(二十)