机器人的WebView风格背景色:在Android 2.2的透明忽略机器人、背景色、透明、风格

2023-09-11 20:16:16 作者:姐不温柔不淑女、又怎样

我努力创建具有透明背景的WebView。

I'm struggling to create a WebView with transparent background.

webView.setBackgroundColor(0x00FFFFFF);
webView.setBackgroundDrawable(myDrawable);

然后我打开一个HTML页面

Then I load a html page with

<body style="background-color:transparent;" ...

web视图的背景颜色是透明的,但只要在页面加载,它是由一个黑色的背景从HTML页面覆盖。这只是发生在Android 2.2,它适用于Android 2.1系统。

The background color of the WebView is transparent but as soon as the page is loaded, it's overwritten by a black background from the html page. This only happens on android 2.2, it works on android 2.1.

那么,有没有东西在HTML页面code加入,使之真正透明?

So is there something to add in the html page code to make it really transparent ?

推荐答案

其实这是一个错误,没有人找到了一个解决办法为止。一个问题已创建。该缺陷还是要在蜂窝。

Actually it's a bug and nobody found a workaround so far. An issue has been created. The bug is still here in honeycomb.

请明星,如果你认为这是很重要的:http://$c$c.google.com/p/android/issues/detail?id=14749

Please star it if you think it's important : http://code.google.com/p/android/issues/detail?id=14749