Webview height not changing after resize font size

☆樱花仙子☆ 提交于 2019-12-01 22:22:51

you might have to reload your webview with ie:

webview.loadUrl( "javascript:window.location.reload( true )" );

I had the same problem and fixed it using code:

private void reloadWebView() {
    postDelayed(new Runnable() {
        @Override
        public void run() {
            clearView();
            requestLayout();
        }
    }, 10);
}

Call it method when You have finished zooming. It will refresh web view and recalculate it size.

You can use this:

myWebView.loadUrl("about:blank");
Venkatesh S
private void reloadWebView() {
    // TODO Auto-generated method stub
    postDelayed(new Runnable() {
        @Override
        public void run() {
            clearView();
            reload();               
            myWebView.getSettings().setJavaScriptEnabled(true);
            requestLayout();
        }
    }, 10);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!