Android WebView performance

后端 未结 4 1242
春和景丽
春和景丽 2020-12-08 05:32

In my app, I am loading a list of external url\'s in webview and allow user to flip through them. Webviews are loaded on to a view flipper. I find the performance is reall

4条回答
  •  庸人自扰
    2020-12-08 06:02

    Try this:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        webView.setLayerType(View.LAYER_TYPE_HARDWARE, null); 
    } else {
        webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    }
    

提交回复
热议问题