在web视图双指缩放[机器人] [英] Pinch Zoom in webview [Android]
问题描述
在我的网站,其在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("http://www.mysite.com/mypicture.jpg");
// enable pinch-zoom abilities on the image
new PinchImageView(img);
这篇关于在web视图双指缩放[机器人]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!