Webview height not changing after resize font size

前端 未结 4 1862
猫巷女王i
猫巷女王i 2021-01-20 04:16

In my application I use a ScrollView. This ScrollView contain many Webview. I change the webview font size:

webView.getSettings().setTextSize(WebSettings.Tex         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-20 04:41

    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.

提交回复
热议问题