I've a webview that loads a website from local assets folder:
webView = (WebView) findViewById(R.id.webView);
//webView.setInitialScale(1);
//webView.getSettings().setDefaultZoom(WebSettings.ZoomDensity.FAR);
//webView.getSettings().setLoadWithOverviewMode(true);
//webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
webView.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
webView.setVisibility(View.VISIBLE);
}
});
if ((Locale.getDefault().getLanguage()).contains("ar"))
webView.loadUrl("file:///android_asset/Index-ar.html");
else
webView.loadUrl("file:///android_asset/Index-en.html");
By default, the webpage is zoomed in and the user have to scroll and all what I want is to fit the page width to the webview width (which is full screen).
The comments shows you what I've tried:
setInitialScale(1)
hides all the content of the page!
setDefaultZoom(WebSettings.ZoomDensity.FAR)
changes nothing.
setLoadWithOverviewMode(true)
and setUseWideViewPort(true)
zooms out to much.
Any suggestions ?