How to get width and height of a Webview in android

后端 未结 12 1131
长发绾君心
长发绾君心 2021-01-04 17:13

I want to determine the width and the height of the WebView. I have already tried it using:

webView.getWidth();
webView.getHeight();
         


        
12条回答
  •  借酒劲吻你
    2021-01-04 17:41

    If you want to get The Height and Width load time you can't get it because load time can't get it. I suggest to use the webview Touchevent and get the height and width. Otherwise use another view click event and get the height and width.

    webView.getWidth();
    webView.getHeight();
    

    Use this.

提交回复
热议问题