Setting WebView initial zoom out to a particular value - android

I had added a few images in webview and also have the zooming feature. but initially the webview is so small that a person cannot read the data of the images until he zooms to read it. so I just want to know how can I set webview initial zoom feature to a particular value
webView = (WebView) findViewById(R.id.phy_law_web);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.loadUrl("file:///android_asset/mathscribe/Analyticgeometry.html");
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);

Related

Load url with minimum zooming width - android

I have a web view and when it is loading URL, it is already zoomed in with some percentage. i.e. user has to scroll horizontally to see the entire content. I want to load the web page with minimum zooming size. i.e. user cannot be zoom out anymore at the time of loading. I tried below, but it is showing the entire page in the web view at once. ultimately I want to fit the web page horizontally.
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
Just use setMinimumFontSize and setUseWideViewPort(true) like below. (Y)
WebView wv = (WebView) findViewById(R.id.webview1);
wv.getSettings().setLoadWithOverviewMode(true);
wv.getSettings().setUseWideViewPort(true);
wv.getSettings().setMinimumFontSize(35);

Zoom image in Webview

I have an image and other elements (div, titles etc.) in my webview and i need only the image to zoom on click, like picture in gallery. Something like in this tutorial. but in webview. I only found, how to zoom whole webview.
You can use this.
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("file:///android_asset/images/yourimage.png");
webview.getSettings().setSupportZoom(true);
webview.getSettings().setBuiltInZoomControls(true);

Android WebView for long images

I'm using WebView as an image viewer in my android application.
The image size is 750X3500 and I need to view the whole image, i.e. I want the maximum zoom out in order the image fit the screen.
It seems to me like impossible mission so far :(
Here is my WebView initialization code:
WebSettings webSettings = mWebView.getSettings();
webSettings.setLoadsImagesAutomatically(true);
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setDefaultZoom(ZoomDensity.FAR);
mWebView.getSettings().setLoadWithOverviewMode(true);
mWebView.getSettings().setUseWideViewPort(true);
mWebView.getSettings().setJavaScriptEnabled(true);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
And here is a sample image:
http://linkpeek.com/m/vault/c/8/3/c835da21e9d3bd65359d024d0feff30f4eb77cacccf6e477bc9fbb52848984cf.png
Any idea guys?
Thanks.
If you use an HTML page to load the image, then you can use "viewport" HTML meta to control how it displays and zooms.

Android: Unable to zoom in/out webview for mobile site

I cannot seem to get the Android webview to zoom in or out for mobile sites like:
http://m.bbc.co.uk
The webpage just comes out in a single column.
I tried:
I have tried different permutations (true/false) with
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);
I have also tried to
WebView.getSettings().setSupportZoom(true);
WebView.getSettings().setBuiltInZoomControls(true);
but it is still not working for me.
have you tried setBuiltInZoomControls
WebView.getSettings().setBuiltInZoomControls(true);

I'm having trouble loading a webpage neatly in webview

Everytime I load a page in the webview, the webview tries to squash the web page into a small frame. However, in the standard android browser, it loads the page at the full size and allows the user to zoom in however much they decide.
Is there anyway to make a webview load a page like the default web browser?
Something like this:
WebView wv;
WebSettings webSettings = wv.getSettings();
webSettings.setBuiltInZoomControls(true); //when you define webview settings just add this to enable zoom
wv.setInitialScale(1); //lets set initial zoom to 1% to see whole page when it loads

Categories

Resources