Does it matter if i return true
or false
in onTouch()
of an OnTouchListener
?
I can't see any difference between returning true
or false
in this example: Android Swipe on List
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- how to split a list into a given number of sub-lis
- Listening to outgoing sms not working android
The return value determines if you consumed the touch event.
In other words
true
means that this touch event is interesting to you and all follow up calls of this touch event likeACTION_MOVE
orACTION_UP
will be delivered to you.If you return
false
than the touch event will be passed to the nextView
further up in the view hierarchy and you will receive no follow up calls. The touch event will continue to be passed further up the view hierarchy until someone consumes it.If you have any further questions please feel free to ask!