Android - 单个视图上的多个侦听器能够将事件传递给其他视图
我有一个包含 ScrollView 的图库。我可以按照标准方式通过垂直滑动来滚动 ScrollView 中的文本。但是,我希望 ScrollView 也能够监听水平滑动,然后向左或向右移动图库。有谁知道该怎么做?
谢谢。
I have a Gallery that contains a ScrollView. I can scroll through the text in the ScrollView with a vertical swipe as is standard. However, I would like the ScrollView to also listen for horizontal swipes which would then move the Gallery left or right. Does anyone know how to do that?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,这就是我发现的。您将需要使用 onInterceptTouchEvent()。您可以在这里阅读: http://developer.android.com/reference/ android/view/ViewGroup.html
或者,您可以搜索 onInterceptTouchEvent 示例来查找几个示例。
Okay, here is what I found. You will need to use onInterceptTouchEvent(). You can read about it here: http://developer.android.com/reference/android/view/ViewGroup.html
Alternatively, you can do a search for onInterceptTouchEvent example to find several examples.