Search code examples
androidandroid-webview

Webview zoom out programmatically


I have a webview displaying a map as an svg object. Users can zoom in and out using pinch controls. I also have a button outside of webview that should animate zooming out to default zoom level.

I'm unable to find a way to write a zoom out javascript code that actually works on webview.


Solution

  • you can handle zoom percent like this:

    mWebView.setInitialScale(ZOOM_LEVEL);
    

    which ZOOM_LEVEL is zoom percentage number