首页 >web前端 >html教程 > 正文

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

原创2016-06-24 11:17:540473
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];
php中文网最新课程二维码

声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理

相关文章

相关视频


网友评论

文明上网理性发言,请遵守 新闻评论服务协议

我要评论
  • 专题推荐

    作者信息

    php中文网

    认证0级讲师

    推荐视频教程
  • javascript初级视频教程javascript初级视频教程
  • jquery 基础视频教程jquery 基础视频教程
  • 视频教程分类