The default Browser app for Android shows zoom controls when you're scrolling and also allows for pinch zooming. How can I enable this feature for my own Webview?
I've tried:
webSettings.setBuiltInZoomControls(true); webSettings.setSupportZoom(true);
but neither of the features get enabled as a result. Btw I've set a WebChromeClient
and a WebViewClient
for the Webview if that makes a difference.
Thanks!
This example demonstrate about How to enable webview zoom controls in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.
getSettings(). setBuiltInZoomControls(true); per this answer to default my view to zoomed out and to be able to pinch-to-zoom.
Press and hold Ctrl and press and hold left mouse and while doing that move your mouse.
Strange. Inside OnCreate method, I'm using
webView.getSettings().setBuiltInZoomControls(true);
And it's working fine here. Anything particular in your webview ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With