I am creating an android application to detect the gestures. For this I have referred the following link.

In the main.xml, they are using android.gesture.GestureOverlayView to find the gesture. But I want to use Imageview instead of android.gesture.GestureOverlayView.

Note: I have searched in the internet. I got the following ref. But this is not helped me.

Android Gestures over an image

Is it possible? How can I achieve this?

有帮助吗?

解决方案

Please read the documentation of GestureOverlayView:

A transparent overlay for gesture input that can be placed on top of other widgets or contain other widgets

Note the two words transparent and overlay. You can use it on top of any view - just use an appropriate Layout (Hint: try FrameLayout or RelativeLayout) or add views to it (as it is a sub-class of FrameLayout).

There are tutorials out there like this: Android Gestures - Tutorial.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top