Hi Friend... a simple question... Is it possible to Load a URL in a webView and resize it to fit the screen... i Mean i want to make the WebPage small so that the user doesnt need to scroll... IS it possible????
Have you tried just calling WebView.zoomOut()
repeatedly until it returns false
?
Also, I would note that this technique you want to use really relies on the web page being quite short. If the page is long and you zoom out to fit it entirely on screen, the user is going to need very good eye sight! ;)
Hi,
I've the same problem. I can't fit the WebView to screen.
I tried WebView.zoomOut() but it didn't work on Android 2.1
I found a solution like this:
WebView.getSettings().setDefaultZoom(ZoomDensity.FAR);
But it isn't enough to fit my WebView to screen.
Any ideas??
@user289751, yalçın
well friends as "Christopher" mentioned, zooming out too much is not something the user would like coz it'll reduce the legibility of the content shown...
rather i would like to suggest a alternate... its better u try setting the zoom controls... don know if they'll work in 2.1 or not...
webview.getSettings().setBuiltInZoomControls(true);
hope this solves ur problem... coz now u r giving user the control to change the zoom level...
I got this to work in a dialog using WRAP_CONTENT for both dimensions of the WebView, unfortunately when the web page becomes too large the webview pushes all my other widgets off the screen.
Android's layout system is pretty damn unintuitive!
I have a problem too with webkit. I am trying to make it take half the screen of my app cause I have widgets with information on the top but it just opens in a new browser which takes all the screen. Is there a way to make it smaller? I have tried alot of combination with the layouts etc but with no luck...
You can also try setting an layout algorithm for the same.It worked for me
webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
webview.setInitialScale(number);
where the higher 'number' is, the more zoomed in your page will be. start with lower numbers ( like 10) and adjust to taste