Android Swipe to left or right?

后端 未结 2 1967
不知归路
不知归路 2020-12-30 17:17

How can I detect in a ListView that someone swiped to the left or the right?

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-30 17:29

    You'll be wanting this excellent tutorial (site died, here's a new link: http://jsharkey.org/blog/2008/09/15/crossing-things-off-lists-in-android-09-sdk/). Essentially, you're going to create a transparent view in front of the ListView which consumes horizontal motionevents and passes non-horizontal motionevents back down to the ListView.

提交回复
热议问题