如何实现一扔Android中的ListView [英] how to implement fling in android listview

查看:99
本文介绍了如何实现一扔Android中的ListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在列表视图中的每个在列表中的每个项目实施 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);

这篇关于如何实现一扔Android中的ListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆