开发者

In android, how to listen to gestures on an ImageView?

开发者 https://www.devze.com 2023-01-24 03:07 出处:网络
I would like to define an ImageView in Xml, and then listen to gestures which occur only on that ImageView.But, it appears that the co开发者_运维知识库nstructor for GestureDector requires an Activity

I would like to define an ImageView in Xml, and then listen to gestures which occur only on that ImageView. But, it appears that the co开发者_运维知识库nstructor for GestureDector requires an Activity as a parameter, and then responds to gesture events on all components in that Activity. Is there any way to limit this such that events are only generated for gestures upon the pre-defined ImageView?

Thank you


extend ImageView and make it implement OnGestureListener `

0

精彩评论

暂无评论...
验证码 换一张
取 消