How do I keep a touch event keep its focus on the widget it was started in?

前端 未结 2 1761
野趣味
野趣味 2021-01-07 02:36

Let\'s say I have a ListView, and one row in it is a custom View of mine. The user touches inside the custom view -> custom View gets to handle this touch event. User contin

相关标签:
2条回答
  • 2021-01-07 03:00

    To get all following events I also had to call view.getParent().requestDisallowInterceptTouchEvent(true) in my onTouch Listener.

    0 讨论(0)
  • 2021-01-07 03:07

    According to this post by Dianne Hackborn, if you return true to a down event in a view's onTouchEvent(), following events are sent automatically to that view.

    0 讨论(0)
提交回复
热议问题