WebView “flashing” with white background if hardware acceleration is enabled (Android 3.0+)

前端 未结 6 1451
再見小時候
再見小時候 2020-12-13 05:53

I have an issue with the WebView (Android 3.0+), which the WebView always displays a white background before display my black background (\"flashing\"). Here is my simple te

6条回答
  •  独厮守ぢ
    2020-12-13 06:39

    I have enabled the hardware acceleration for the application and have disabled it for the activity. Additionally I set the background to null, as mentioned above. It works for me now.

    Another approach (untested): set the layer type to software rendering and set the background to Color.TRANSPARENT (or 0): webview.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

    Greetz Thorsten

提交回复
热议问题