William Lewis
William Lewis

Reputation: 536

Non-visible zoom controls in WebView

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

Upvotes: 5

Views: 5555

Answers (1)

user370305
user370305

Reputation: 109237

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.

Upvotes: 10

Related Questions