UIWebView加载本地html ios
来源:互联网 发布:网易软件 编辑:程序博客网 时间:2024/05/28 16:25
浏览器访问
1、首先将写好的html页面与js,css文件放到一文件夹中
2、将文件夹直接重命名为bundle文件,例如文件夹名称test重命名为test.bundel
3、将这个test.bundel加入到你的工程中
4、UIwebview加载首页
NSString *bundlePath = [[NSBundle mainBundle]pathForResource: @"test"ofType:@"bundle"];
NSBundle *htmlbundle=[[NSBundle alloc]initWithPath:bundlePath];
NSString *path = [htmlbundle pathForResource:@"index" ofType:@"html"];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url] ;
[myWebView loadRequest:request];
最终效果
0 0
- UIWebView加载本地html ios
- UIWebView加载本地html
- UIWebView加载本地html
- UIWebView加载本地html
- UIWebView加载本地html
- ios UIWebView 加载本地html,js,css文件的问题
- UIWebView加载本地HTML文件
- UIwebview加载本地html文件
- UIWebView加载本地HTML文件
- UIWebview加载本地html文件
- iOS UIWebView加载本地图片
- iOS UIWebView加载html代码
- iOS UIWebView 加载本地html文件 同时加载javascript文件,javascript文件无效
- UIWebview和WKWebview加载本地html
- iOS 加载本地html
- iOS加载本地HTML
- iOS UIWebView 加载本地h5总结
- iOS-通过UIWebView加载本地HTML5文件
- 常见HTTP状态(304,200等)
- css3 新属性
- linux命令
- 黑马程序员,黑马论坛---JavaEE第4期,毕业7天,34人就业平均薪资7308
- POI获取excel中函数计算所得的值
- UIWebView加载本地html ios
- poj 1679 The Unique MST (判断最小生成树是否唯一)
- hdu 4973 A simple simulation problem 线段树 2014 Multi-University Training Contest 10-1003
- SQL Server 2008 分页获取数据列表
- thinkphp 权限验证
- 逗B少年搞程序14 时间越来越不够了哦
- spring自学笔记-搭建与测试Spring的开发环境
- 黑马程序员,黑马论坛----'黑马.Net10期,毕业90天,100%全部就业,平均薪水7089元!
- 使用JDBC连接数据库