如何在Android网页浏览中隐藏缩放控件?

时间:2011-12-09 00:26:49

标签: android android-webview

根据标题,我如何在webview中隐藏缩放控件?

3 个答案:

答案 0 :(得分:21)

您应该使用WebSettings并将setDisplayZoomControls设置为false。这将允许用户仍然使用捏缩放,但不会显示控件。

    myWebView.getSettings().setDisplayZoomControls(false);

答案 1 :(得分:0)

WebView.getSettings().setBuiltInZoomControls (false);

我认为你在找什么。

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

答案 2 :(得分:0)

嗯,事实上,

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

myWebView.getSettings().setDisplayZoomControls(false);

共享相同代码

 /**
 * 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);
}

只是有不同的名字