根据标题,我如何在webview中隐藏缩放控件?
答案 0 :(得分:21)
您应该使用WebSettings并将setDisplayZoomControls设置为false。这将允许用户仍然使用捏缩放,但不会显示控件。
myWebView.getSettings().setDisplayZoomControls(false);
答案 1 :(得分:0)
WebView.getSettings().setBuiltInZoomControls (false);
我认为你在找什么。
答案 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);
}
只是有不同的名字