禁用捏放大的WebView?WebView

2023-09-06 07:52:27 作者:昊天之尊

我要建一个应用程序,显示一个的WebView一些内容。我这个样式的内容以适合屏幕并没有缩放是必要的。有没有办法不关闭一个web视图的缩放功能?

解决方案

  wv.getSettings()setSupportZoom(假)。
 

是你想要的。与setBuiltInZoomControls也不会禁用多点触控缩放,但这确实。虽然其值得注意的是,根据设备变焦可能默认被禁用。我与它和我的HTC G2一个web视图的应用程序,它不会让我放大的。但完全相同的code将使缩放的银河平板电脑。

I'm building an app that displays some content in a WebView. I'm styling this content to fit the screen and no zooming is needed. Is there a way do turn off the zooming features of a WebView?

解决方案 新版Edge 浏览器的禁用扩展提示

wv.getSettings().setSupportZoom(false);

Is what you want. with setBuiltInZoomControls it won't disable multitouch zooming but this does. Although its worth noting that depending on the device zooming may be disabled by default. I have an app with a WebView in it and on my HTC g2 it doesn't allow me to zoom at all. But the exact same code will allow zooming on Galaxy Tablet.