开发者

Android: Handling tap event on an ImageView inside of a HorizontalScrollView

开发者 https://www.devze.com 2023-04-09 12:47 出处:网络
I have a bunch of ListViews inside of a HorizontalScrollView. I would like to have a \"tap\" event when the user taps on the image. Currently I am using the OnTouch event but this is a problem. If I s

I have a bunch of ListViews inside of a HorizontalScrollView. I would like to have a "tap" event when the user taps on the image. Currently I am using the OnTouch event but this is a problem. If I swipe the HorizontalScrollView to view more images, the OnTouch event gets fired as soon as I swipe. I really only want it to get fired when I tap on an i开发者_C百科mage but not when I am swiping the actual list of images. Any idea how to do that? Thank you!


You should use onClick instead of onTouch I think.

0

精彩评论

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

关注公众号