如何在Android webview中隐藏缩放控件?

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

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

myWebView.getSettings().setDisplayZoomControls(false); 
 WebView.getSettings().setBuiltInZoomControls (false); 

我想你正在寻找什么。

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

好吧,事实上,

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

只是有不同的名字