user1679416
user1679416

Reputation: 11

Disable webview zoom in android

How to disable zoom effect in webview....i am trying below code but its not working for me

mWeb = (WebView) findViewById(R.id.web);
mWeb.setBackgroundColor(Color.parseColor("#1d1d1d"));
WebSettings mWebSetting=mWeb.getSettings();
mWebSetting.setBuiltInZoomControls(false);

Upvotes: 0

Views: 2889

Answers (3)

Zirk Kelevra
Zirk Kelevra

Reputation: 230

on Api 11 or greater you may be able to use

mWeb getSettings().setBuiltInZoomControls(false);
mWeb.getSettings().setDisplayZoomControls(false);

Upvotes: 0

Chirag
Chirag

Reputation: 56925

wv.getSettings().setSupportZoom(false);

setBuiltInZoomControls it won't disable multitouch zooming but this does.

Upvotes: 2

user1357696
user1357696

Reputation:

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

It will work from Api level 11 only.. see this: http://developer.android.com/reference/android/webkit/WebSettings.html#setDisplayZoomControls%28boolean%29

Upvotes: 0

Related Questions