加载本地HTML文件到web视图 [英] Load local HTML file into WebView

查看:244
本文介绍了加载本地HTML文件到web视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一起指向的是其他一些资源(CSS文件和JavaScript库),我想加载到一个web视图本地的HTML页面。这怎么可能实现?

I have a local html page along with several other resources pointed by it (css files and Javascript libraries) that I would like to load into a WebView . How could this be achieved ?

也许不是最好的方式,以PROCEDE但我仍然尝试。

Perhaps not the best way to procede but I'm still experimenting.

推荐答案

最简单的方法很可能是把你的web资源到资产的文件夹中,然后调用 webView.loadUrl(文件:/// android_asset / filename.html); 。对于Java和web视图<一间完整的通信href="http://androidtrainningcenter.blogspot.in/2012/11/android-webview-loading-custom-html-and.html">See这

The easiest way would probably be to put your web resources into the assets folder then call webView.loadUrl("file:///android_asset/filename.html");. For Complete Communication between Java and Webview See This

这篇关于加载本地HTML文件到web视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆