Android的ViewFlipper +手势检测 [英] Android ViewFlipper + Gesture Detector

查看:156
本文介绍了Android的ViewFlipper +手势检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的手势探测器捕捉甩,并使用视图的鳍状肢来改变屏幕时,出现这种情况。我的一些子视图包含列表视图。该手势检测不会识别刷卡,如果你刷卡的列表视图。但它会识别它,如果它是onTop的TextView的或的ImageView的。有没有一种方法来实现它,这样它会识别挥笔,即使他们是在另一种观点认为,有一个ClickListener的顶部?

I am using gesture detector to catch "flings" and using a view flipper to change the screen when this happens. Some of my child views contain list views. The the gesture detector wont recognize a swipe if you swipe on the list view. But it will recognize it if it is onTop of TextView's or ImageView's. Is there a way to implement it so that it will recognize the swipes even if they are on top of another view that has a ClickListener?

推荐答案

感谢您的回答。为了得到它的工作我怎么想它我不得不补充的是:

Thank you for your answer. In order to get it working how I wanted it to all I had to add was this:

myList.setOnTouchListener(gestureListener);

myList.setOnTouchListener(gestureListener);

,我的每个列表。现在他们正确识别为滚动列表水平挥笔改变看法,垂直运动。

for each of my lists. Now they correctly recognize horizontal swipes to change views, and vertical movement for scrolling the list.

这篇关于Android的ViewFlipper +手势检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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