Multiple Views OnTouch Events

后端 未结 3 1360
迷失自我
迷失自我 2021-01-02 05:56

We are developing an application where we need to capture MotionEvents from multiple views simultaneously. When we try to do so, Android only dispatches events to the first

3条回答
  •  难免孤独
    2021-01-02 06:30

    Touch event is first catched by the view currently in focus. If you touched 1 view and have "consumed" event and are working with it, any other events will be dispatched to this view, no matter where you click.

    If you return false from your touchListener (thus saying that event is not consumed) it will be delegated down to other views, but on another separate click new event will be dispatched to other view.

    http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-3-understanding-touch-events/1775

    http://developer.android.com/guide/topics/ui/ui-events.html

提交回复
热议问题