Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android WebView Zoom out limited

I am using a WebView in Android. After loading a webpage I would like to use the on-screen Zoom out control. After one or two clicks it becomes grayed and no longer allows me to zoom out any further. When I call the zoomOut() function in code, it also does not zoom out any further.

What is limiting how much I can zoom out. I would expect to be able to zoom out much further than I am allowed - to the point of making the page too small to read. But, zoom out is disabled well before I reach this level of zoom.

Any help is greatly appreciated.

Thanks, Barry.

like image 623
Barry Avatar asked Jul 22 '11 02:07

Barry


2 Answers

You should probably do this myWebView.getSettings().setUseWideViewPort(true)

You'll then see that you can zoom out farther than what you usually see on default settings.

like image 96
wnafee Avatar answered Nov 15 '22 16:11

wnafee


Take a look at WebView.setInitialScale(...) - I'm not sure if it will help you with what you want but setting it to 50, for example, will scale the WebView to 50% of its normal size. I think that will allow you to zoom in and then out again to the (initial) smaller size.

like image 2
Squonk Avatar answered Nov 15 '22 17:11

Squonk