PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

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

原创
2016-06-24 11:17:54 922浏览

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核实处理。