捕捉新的谷歌地图API的Andr​​oid V2双击事件 [英] Catch double tap events on new Google Maps Android API v2

查看:215
本文介绍了捕捉新的谷歌地图API的Andr​​oid V2双击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,有一个图形页面(V1)和另一查看和使用GestureDetector我可以检测双水龙头和2次之间切换的ViewSwitcher的应用程序。

I have an app with a ViewSwitcher that has a MapView (v1) and another View and using a GestureDetector I can detect double taps and switch between the 2 views.

现在我想应用程序切换到新的谷歌地图API的Andr​​oid V2 和我有对的MapView设置GestureDetector不再发生反应,双水龙头的问题,而不是地图在放大。没有人知道如何改变这种行为?

Now I'm trying to switch the app to the new Google Maps Android API V2 and I have the problem that the GestureDetector set on the MapView no longer reacts to double taps, instead the map is zooming in. Does anyone know how to change that behaviour?

我用生图形页面类的工作,而不是地图片段。

I'm working with the raw MapView class, not the Map fragment.

推荐答案

好吧,我发现现在的一种方式。我要创建一个子类的图形页面(这实际上是一个的ViewGroup ),并实施 interceptTouchEvent()那里发现和捕捉双水龙头。

Okay, I found a way now. I have to create a sub class of MapView (which is actually a ViewGroup) and implement interceptTouchEvent() there to detect and catch double taps.

如何对此进行了详细的实施在此说明:<一href=\"http://stackoverflow.com/questions/2691235/double-tap-zoom-on-android-mapview/12646465#12646465\">Double点击 - &GT;在Android MapView的缩放?

How this is implemented in detail is explained here: Double Tap -> Zoom on Android MapView?

这篇关于捕捉新的谷歌地图API的Andr​​oid V2双击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆