I need to find a way to programmatically zoom out of a WebView on android. Background: I created a phonegap/cordova web app which has a fixed layout. I am using these settings to proper display of the app across devices:
this.appView.getSettings().setUseWideViewPort(true);
this.appView.getSettings().setLoadWithOverviewMode(true);
this.appView.getSettings().setSupportZoom(true);
this.appView.getSettings().setDefaultZoom(ZoomDensity.FAR);
this.appView.getSettings().setBuiltInZoomControls(true);
this.appView.setInitialScale(0);
So far it worked well until a text input field gains focus. Then the app gets rescaled and its impossible to return to the proper view. I searched and worked on this problem for over a day now tried many possible solutions but none worked for me. The approach I am working now on is to make a native call when the text input field looses focus and then to reset the zoom. But I don't know a way to reset the zoom.
webView.zoomOut();
is too slow and webView.setInitialScale(..);
does nothing.
I am looking for something like webView.setZoomLevel(..);
or webView.setScale(..);
but I can not find it in the api.
Pulling out my hair about this.. Please help.
BTW, my meta viewport setting is
<meta name="viewport" content="width=640,height=device-height,target-densityDpi=device-dpi" />