zoukankan      html  css  js  c++  java
  • UIWebView加载本地html文件

    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];
  • 相关阅读:
    .net软件开发工程师面试题
    html笔记
    好用软件
    谷歌插件
    vue笔记
    js笔记
    数组去重
    css全局样式
    css笔记
    vscod插件
  • 原文地址:https://www.cnblogs.com/fengmin/p/5504010.html
Copyright © 2011-2022 走看看