簡體   English   中英

如何從資產文件夾中的HTML文件訪問可繪制文件夾中的圖像?

[英]How to access an image in the drawable folder from within an HTML file in the assets folder?

我正在使用XML文件在我的應用程序中顯示“關於”頁面。 該xml文件位於資產文件夾中,並使用WebView布局顯示。

我想使用CSS為該xml文件設置背景圖片。 該圖像位於drawable-mdpi文件夾中。 有什么方法可以訪問該圖像?

我的意思是這樣的? (當然也可以選擇)

<style type="text/css">
body{
background-image:url('path-to-image-in-drawable-mdpi');
}
//...
</style>

謝謝你的幫助 :)

如果你寫就可以了

<script type="text/css">
body{background-image:url('file:///android_res/drawable/file_name.jpg');}
</script>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM