How to get width and height of a Webview in android
问题 I want to determine the width and the height of the WebView . I have already tried it using: webView.getWidth(); webView.getHeight(); but the resulting log always shows them to be 0. 回答1: Here's a more elegant solution public void onCreate(Bundle savedInstanceState) { webView = (WebView) findViewById(R.id.webView1); webView.addOnLayoutChangeListener(new OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right,int bottom, int oldLeft, int oldTop, int