在 Android 上同时触摸 MapView 和 Button
我创建了一个 MapActivity,其中包含一个 MapView 和 MapView 顶部的一个按钮。
像这样:
我想要用户用一根手指触摸mapView的一个点,然后用另一根手指触摸“添加地点”按钮(MapView仍然由第一根手指推动)。
问题是当第一个手指触摸mapView时,就像mapView获得焦点一样。 因此,当第二根手指触摸“添加地点”按钮时,它会被识别为第二根手指触摸了放置“添加地点”按钮的位置的地图视图
我有一台带有 Froyo 的 Nexus One,因此它应该支持多点触控...
您认为我应该怎么做才能使多点触控在这种情况下工作?!?
感谢您的帮助!!!! :)
I created a MapActivity that contains a MapView and a Button on the top of the MapView.
Like this:
I would like that the user touch a point of the mapView with a finger and then touch the button "Add Place" with another finger (the MapView is still pushed by the first finger).
The problem is when the first finger touch the mapView, it is like if the mapView gains the focus.
So when the second finger touch the button "Add Place" it is recognized as the second finger touched the mapView in the location where it is placed the button "Add Place"
I have a Nexus One with Froyo and so it should support multi-touch...
What do you think should I do to make multi-touch working in this context?!?
THANKS FOR YOUR HELP!!!! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
多点触控在 Nexus One 上不可用,由于 Apple 的一项专利 关于此功能。
因此,除非您的用户root了他们的手机,否则这是不可能的。
但是,您无需多点触控即可执行您的想法。只要在你的mapView上添加一个clickListener,然后弹出一个AlertDialog来提供“添加地点”的机会(如果他愿意的话)?
Multitouch is not available on the Nexus One, because of a patent from Apple on this feature.
So unless your users root their phone, this won't be possible.
However, you can execute your idea without multitouch. Just add a clickListener on your mapView, and pop up an AlertDialog to offer the opportunity to "Add a place" if he wants?