UIWebView加载html(转)
来源:互联网 发布:datatype json jsonp 编辑:程序博客网 时间:2024/05/24 04:12
转自:http://blog.csdn.net/lijiacumt/article/details/7190751
1、加载网络html文件:
[html] view plaincopy
- NSURL *url = [NSURL URLWithString:@"http://localhost:8080/jmDemo/index.html"];
- NSURLRequest *request = [NSURLRequest requestWithURL:url];
- [_webView loadRequest:request];
2、加载本地html文件,在iphone项目里面
[html] view plaincopy
- NSString *path = [[NSBundle mainBundle] pathForResource:@"indedx" ofType:@"html"];
- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:path]];
- [_webView loadRequest:request];
3、加载本地html文件,不在iphone项目里面,在Documents文件夹里
[html] view plaincopy
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSString *documentsDirectory = [paths objectAtIndex:0];
- NSString *path = [documentsDirectory stringByAppendingPathComponent:@"index.html"];
- NSURL *url = [NSURL fileURLWithPath:path];
- NSURLRequest *request = [NSURLRequest requestWithURL:url];
- [_webView loadRequest:request];
阅读全文
0 0
- UIWebView加载html(转)
- UIWebView加载html
- uiwebView 加载html字符串
- UIWebView加载html
- UIWebView加载本地html
- UIWebView加载本地html
- UIWebView 加载 HTML
- uiwebview加载html代码
- UIWebView加载本地html
- UIWebView加载本地html
- UIWebView加载html标签
- UIWebView加载本地HTML文件
- UIWebView加载本地html ios
- UIWebView(一):加载html
- UIwebview加载本地html文件
- html代码加载到UIWebView
- UIWebView加载本地HTML文件
- iOS UIWebView加载html代码
- C语言标准字符串分割
- 牛客网Linux基础分析(知识点记录 11-03)
- 机房收费系统之日、周账单
- 已知直线过两点,和线外一点,求直线和垂足及垂距
- 运行pycharm 时出现Cannot read scheme _@user_Monokai.icls from '$ROOT_CONFIG$/colors': Unsupported color
- UIWebView加载html(转)
- ipad横竖屏尺寸(转载)
- python26高级[读写Excel](转)
- tomcat配置使用(转)
- MVP+Fresco+RxJava
- HBase之BlockCache数据读取
- Spring(2)ioc操作
- ardoino人类智能机械未来的希望
- 移植mtd-utils-1.5.1到arm记录