Search code examples
androidbackgroundwebviewtransparencytransparent

Android WebView style background-color:transparent ignored on android 2.2


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

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

Then I load a html page with

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

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.

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


Solution

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

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