在web视图双指缩放[机器人]缩放、视图、机器人、web

2023-09-06 00:22:46 作者:调皮的小乖比

在我的网站,其在web视图加载,有一个地图。还有Java脚本检测枪王放大,拖拽等,但是,它可能有一个JavaScript检测使用双指缩放的?也有它的工作在iPhone上几个例子,并在我的网站没有为双指缩放一个脚本,但它是唯一的工作在iphone .....

On my website, which is loaded in the webview, there is a map. There are also java scripts that detects double tap for zoom, dragging etc. But is it possible to have a javascript that detects the use of pinch zoom ? there are several examples of it working on an iphone, and on my website there is a script for the pinch zoom but it is only working on iphone.....

是否有可能得到它的工作在Android?

Is it possible to get it to work on Android ?

感谢

推荐答案

有一个名为的 Android的捏,您可以在您的项目,以使双指缩放,如果您打开的WebView WebImageView 。下面是使用的例子...

There's an open-source library called android-pinch that you can include in your project to enable pinch zoom if you switch your WebView to a WebImageView. Here's an example of usage...

// create the WebImageView object from xml
WebImageView img = (WebImageView) findViewById(R.id.main_pic);
// fetches the image in a background thread
img.setImageFromURL("https://m.xsw88.com/allimgs/daicuo/20230906/291.png.jpg");
// enable pinch-zoom abilities on the image
new PinchImageView(img);