Skip to content Skip to sidebar Skip to footer

Webview Height Not Changing After Resize Font Size

In my application I use a ScrollView. This ScrollView contain many Webview. I change the webview font size: webView.getSettings().setTextSize(WebSettings.TextSize.LARGER); after I

Solution 1:

you might have to reload your webview with ie:

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

Solution 2:

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.

Solution 3:

You can use this:

myWebView.loadUrl("about:blank");

Solution 4:

private void reloadWebView() {
    // TODO Auto-generated method stubpostDelayed(new Runnable() {
        @Override
        public void run() {
            clearView();
            reload();               
            myWebView.getSettings().setJavaScriptEnabled(true);
            requestLayout();
        }
    }, 10);
}

Post a Comment for "Webview Height Not Changing After Resize Font Size"