magemello
magemello

Reputation: 1202

How can I hide the zoom control in an Android webview?

As per the title, how I can hide the zoom control in a webview?

Upvotes: 12

Views: 11376

Answers (3)

Alex
Alex

Reputation: 41

well, infact ,

WebView.getSettings().setBuiltInZoomControls (false); (<11)

and

myWebView.getSettings().setDisplayZoomControls(false);

shared same code

 /**
 * Sets whether the zoom mechanism built into WebView is used.
 */
public void setBuiltInZoomControls(boolean enabled) {
    mBuiltInZoomControls = enabled;
    mWebView.updateMultiTouchSupport(mContext);
}



 /**
 * 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
 */
public void setDisplayZoomControls(boolean enabled) {
    mDisplayZoomControls = enabled;
    mWebView.updateMultiTouchSupport(mContext);
}

just have different names

Upvotes: 0

Bobbake4
Bobbake4

Reputation: 24857

You should use WebSettings and set setDisplayZoomControls to false. This will allow the user to still use the pinch to zoom but the controls will not be displayed.

    myWebView.getSettings().setDisplayZoomControls(false);

Upvotes: 24

FoamyGuy
FoamyGuy

Reputation: 46856

WebView.getSettings().setBuiltInZoomControls (false);

Is what you're looking for I think.

http://developer.android.com/reference/android/webkit/WebSettings.html#setBuiltInZoomControls%28boolean%29

Upvotes: 0

Related Questions