首頁 > web前端 > html教學 > UIWebView加载本地html文件_html/css_WEB-ITnose

UIWebView加载本地html文件_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
發布: 2016-06-24 11:17:54
原創
1300 人瀏覽過

UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight-64)];        webView.backgroundColor=YYCToothWashViewBgColor;        [self.view addSubview:webView];        //加载本地html文件    NSString *path = [[NSBundle mainBundle] bundlePath];    NSURL *baseURL = [NSURL fileURLWithPath:path];        //protocal   html文件名称    html文件类型    NSString * htmlPath = [[NSBundle mainBundle] pathForResource:@"protocal"                                                          ofType:@"html"];    NSString * htmlCont = [NSString stringWithContentsOfFile:htmlPath                                                    encoding:NSUTF8StringEncoding                                                       error:nil];    [webView loadHTMLString:htmlCont baseURL:baseURL];
登入後複製

 

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
本地倉庫 - git 如何刪除本地建立的倉庫
來自於 1970-01-01 08:00:00
0
0
0
停止請求在 HTML 文件中加載腳本
來自於 1970-01-01 08:00:00
0
0
0
關於config配置
來自於 1970-01-01 08:00:00
0
0
0
apache不能存取本機文件
來自於 1970-01-01 08:00:00
0
0
0
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板