Skip to content Skip to sidebar Skip to footer

Android, Webview.getwidth() == Window.innerwidth

What combination of META tag settings in HTML and WebSettings in Java should I use to get the following result: window.innerWidth in Javascript should be always (in any Android ver

Solution 1:

  1. META:

    meta name="viewport" content="width=device-width; user-scalable=no; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; target-densityDpi=device-dpi;"

  2. Java:

    _WebView.getSettings().setLoadWithOverviewMode(true); _WebView.getSettings().setUseWideViewPort(true);

This combination works.

Post a Comment for "Android, Webview.getwidth() == Window.innerwidth"