我可以在webview中设置背景图像吗?

时间:2014-09-18 12:01:26

标签: android webview

我想在android中的webview中设置背景图片,这样每当没有加载页面或网址时,它就会在网页浏览中显示背景图片。

2 个答案:

答案 0 :(得分:11)

您可以通过添加以下代码行在Webview中设置背景图片:

webView.setBackgroundResource(R.drawable.image_name);
webView.setBackgroundColor(0x00000000);

答案 1 :(得分:1)

webView.setBackgroundColor(0x00000000); //<-- Color to transparent
webView.setBackgroundResource(R.drawable.backgroundImage);
相关问题