Android webview late rendering

后端 未结 5 2065
野的像风
野的像风 2020-12-20 13:49

I\'ve written an app mostly in JS (Mootools) and HTML which is loaded into webview in my app.

It\'s just one html file which show or hide parts (element

5条回答
  •  隐瞒了意图╮
    2020-12-20 14:12

    Ajay answer gave me a hint of something I used in another project so I could make WebView background transparent. Till now I didn't know that code turns off hardware acceleration. I tested that peace of code in this project and there is no late rendering anymore. although scrolling the page is not as smooth as before but it's better than late rendering.

    This is the code to fix all of this:

    if (Build.VERSION.SDK_INT >= 11) wv.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
    

    By the way, it's like defining android:hardwareAccelerated="false" doesn't affect webview!

提交回复
热议问题