我正在努力创建一个透明背景的WebView.
webView.setBackgroundColor(0x00FFFFFF);
webView.setBackgroundDrawable(myDrawable);
Run Code Online (Sandbox Code Playgroud)
然后我加载一个html页面
<body style="background-color:transparent;" ...
Run Code Online (Sandbox Code Playgroud)
WebView的背景颜色是透明的,但是一旦页面加载,它就会被html页面中的黑色背景覆盖.这只发生在Android 2.2上,它适用于android 2.1.
那么在html页面代码中添加一些内容以使其真正透明吗?
我不只是在寻找API中的Splash Screen功能; 如果可能的话,我希望HTML内容使用透明背景,并依靠WebView提供背景图像.这样的事情可能吗?
除此之外,我是否至少可以在WebView上设置一个"渗透"到HTML内容的背景颜色?