5

I want pinch-to-zoom in WebView but I dont want it to have the integrated control (the little zoom in and zoom out buttons) all I want is the pinch to zoom.
I tried this and it didn't work:

wv1.getSettings().setBuiltInZoomControls(false);
wv1.getSettings().setSupportZoom(true);

Any ideas would be great!

p.s. I'm using API Version 8

William Lewis
  • 536
  • 1
  • 8
  • 26

1 Answers1

10

On API 11 or greater, you can use:

webview.getSettings().setBuiltInZoomControls(true);
webview.getSettings().setDisplayZoomControls(false);

From API 11,

public void setDisplayZoomControls (boolean enabled)

Sets whether the on screen zoom buttons are used. A combination of built in zoom controls enabled and on screen zoom controls disabled allows for pinch to zoom to work without the on screen controls

Look at enable/disable zoom in Android WebView.

Community
  • 1
  • 1
user370305
  • 108,599
  • 23
  • 164
  • 151