How to get width and height of a Webview in android

后端 未结 12 1118
长发绾君心
长发绾君心 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:38

    For anyone else who still struggles. Use these methods to get the height and the width of your webview.

    computeHorizontalScrollRange(); -> for width 
    computeVerticalScrollRange(); -> for height
    

提交回复
热议问题