Web view flicker/blinks while scrolling

后端 未结 3 1680
Happy的楠姐
Happy的楠姐 2021-02-04 15:59

I am working on hybrid application, there are HTML5 files which i bundled within application. I need to play video on some HTML pages for that i used android:hardwareAcc

相关标签:
3条回答
  • 2021-02-04 16:21

    It seems that the android:hardwareAccelerated="true" is the root of the problem. If you really need it, you can solve this issue by calling:

    webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
    

    It requires API level 11, so you can wrap it in a method like this:

    @TargetApi(11)
    protected void configureLayerType(WebView webView) {
        webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
    }
    
    0 讨论(0)
  • 2021-02-04 16:26

    Android web view Rendering Engine makes flickering usually. U can use some javascript mobile frameworks like JQMobi, Enyo js, JQuery Easing JS to solve this issue.

    But what basically i experimented is html browser rendering always flickering in my case.

    0 讨论(0)
  • 2021-02-04 16:33

    I've added:

    android:layerType="software"
    

    to WebView, and it magically solved the problem.

    Of course, left out hardware acceleration.

    0 讨论(0)
提交回复
热议问题