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 doesn\'t need to scroll. Is this possible
I was able to contain the entire page in my view by doing the following. First set the width and height to wrap_content. Then setting the initial scale to one like this:
WebView webview = (WebView) currentActivity.findView(R.layout.web_view, R.id.webview);
webview.setInitialScale(1);
I found that I could get this to keep the width to the minimum necessary to display a readable font and then scroll along the y coordinate every time by doing the following. First set both the height and width to wrap_content. Then set the zoom density to far in your code like this:
WebView webview = (WebView) currentActivity.findView(R.layout.web_view, R.id.webview);
webview.getSettings().setDefaultZoom(ZoomDensity.FAR);
This is probably the better solution most of the time. Consider how small the font would be if you displayed the following web page in its entirety: