Webview setBackgroundColor when playing a gif image

I want to play gif using web view, the default webview background is white.so I use:

webView.setBackgroundColor(Color.TRANSPARENT); 

but when I use the code above, my gif can play, but behind my gif it also draws one gif picture like:

enter image description here

In fig. You will see the redundant snapshot at the back. My original gif pic is as follows:

original gif

When I tried to remove webView.setBackgroundColor(Color.TRANSPARENT) , the gif was showing good, but the background was white.

When I add code, my gif always has a redundant gif image.

So my question is: how can I set my gif background as transparent but not ruin the gif?

+4
source share

Source: https://habr.com/ru/post/1432438/


All Articles