如何在android listview中实现fling [英] how to implement fling in android listview

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

问题描述

我想在列表中的每个项目的列表视图中实现 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(context, new MyGestureDetector());
gestureListener = new View.OnTouchListener() {
    public boolean onTouch(View v, MotionEvent event) {
        return gestureDetector.onTouchEvent(event);
    }
};
mList.setOnTouchListener(gestureListener);

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

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