在考虑其他资源的Andr​​oid HTML资源 [英] Android HTML resource with references to other resources

查看:97
本文介绍了在考虑其他资源的Andr​​oid HTML资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个HTML资源添加到我的Andr​​oid项目,引用其他资源(主要是可绘制)。

I would like to add an HTML resource to my Android project with references to other resources (mainly drawables).

我应该在哪里把它和我怎么引用其他资源呢?

Where should I put it and how do I reference other resources from it?

有没有传递HTML资源到的WebView一种特殊的方式

Is there a particular way to pass the HTML resource to a WebView?

谢谢!

推荐答案

HTML文件进入根的资产文件夹(如水库的兄弟文件夹),以及所有的可绘制。你可以做这样的事情

The html file goes into the assets folder in root (as a sibling folder of res), as well as all the drawables. You can view it by doing something like

webView.loadUrl("file:///android_asset/filename.html");

这篇关于在考虑其他资源的Andr​​oid HTML资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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