A frequent question encountered when using WebView inside of an Android app is “how do I make the background transparent, rather than the default white color?”
This is ridiculously easy:
WebView myWebView = new WebView(this);
myWebView.setBackgroundColor(0);
Happy Coding.
Yeah, this works until you use JavaScript to show/hide a div, or do something else dynamic. The WebView doesn’t clear it’s canvas before drawing to it again, so you get terrible artifacts.
LikeLike
I’m facing exactly the problem you described 😦
Did you find any workarounds for WebView with transparent background not redrawing correctly after JavaScript manipulations?
Thanks!
LikeLike