swift 接入带css的webView
来源:互联网 发布:js面向对象编程oop 编辑:程序博客网 时间:2024/05/17 01:41
有时候需要导入带css js image 文件的本地html 这时候需要注意html 文件的路径 例如路径的模式
第一种方式 加入本地本地html文件时候选择create folder
需要把web的具体路径写出来
let path = Bundle.main.path(forResource: "H5/web/yourWeb", ofType: "html")let path = NSBundle.mainBundle().pathForResource("yourWeb", ofType: "html")let requestURL = NSURL(string:path!)let request = NSURLRequest(url:requestURL! as URL)web.loadRequest(request as URLRequest)
第二种方式 加入本地本地html文件时候选择create groups
这种方式的情况下 需要改变每一个 js文件 web文件 css文件的引用路径 每个文件的 href=”../css/demo.css” 需要改为 href=”demo.css”
let path = Bundle.main.path(forResource: "yourWeb", ofType: "html")let requestURL = NSURL(string:path!)let request = NSURLRequest(url:requestURL! as URL)web.loadRequest(request as URLRequest)
阅读全文
0 0
- swift 接入带css的webView
- Swift加载带导航条的WebView
- WebView:带进度条的WebView
- swift中webview的URL带中文或者特殊字符的处理
- 带进度条的WebView
- 带进度条的webview
- 带进度条的WebView
- 带进度条的webview
- 带进度条的WebView
- 带进度条的WebView
- 带进度条的WebView
- 带进度条的WebView
- cocos2d-x WebView 接入的问题
- swift(ios) webview 的优化
- swift版webview加载网页(带进度条)
- 【Android】带进度条的WebView
- 【Android】带进度条的WebView
- 【Android】带进度条的WebView
- OKHttp(一)---------get方式请求
- Mac电脑使用:Mac系统的触发角使用
- qq,微信截图隐藏对话框
- 算法细节系列(19):广度搜索优先
- h5 form api 表单API
- swift 接入带css的webView
- A律13折线码编码输出、量化误差、以及对应的11位均匀量化编码
- 在Linux上如何验证已下载文件的真实性和完整性
- Container killed by YARN for exceeding memory limits.
- idea创建简单的web工程
- python数据库(一)
- Spring常用注释解析
- 基于腾讯Centos7云服务器搭建SVN版本控制库
- [leetcode: Python]412.Fizz Buzz