Android的刷卡左边还是右边?Android

2023-09-05 09:55:30 作者:  冇┏糹彔┓ 冇┗糹分┛

我如何检测在ListView有人刷卡向左或向右?

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

推荐答案

您会想要的这个优秀的教程 (现场死亡,这里有一个新的链接:的http://jsharkey.org/blog/2008/09/15/crossing-things-off-lists-in-android-09-sdk/).从本质上讲,你要创造一个消费水平motionevents并通过非水平motionevents回落到ListView ListView的前面的透明视图。

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.