如何实现一扔Android中的ListView如何实现、Android、ListView

2023-09-12 09:00:19 作者:情场‵掌控员′

我想在列表视图中的每个在列表中的每个项目实施 onfling (或类似刷卡)。如果我刷那个特定的项目应该显示名称旁边的三个按钮。

I would like to implement onfling (or some similar swipe) in listview in each and every item in list. If I swipe that particular item it should display three buttons next to the name.

有没有什么想法来实现这一点。

Is there any idea to implement this.

推荐答案

我已经实现了这个手势检测的帮助:

I have implemented this with the help of gesture detection:

gestureDetector = new GestureDetector(new MyGestureDetector());
gestureListener = new View.OnTouchListener() {
    public boolean onTouch(View v, MotionEvent event) {
        return gestureDetector.onTouchEvent(event));
    }
};
mList.setOnTouchListener(gestureListener);