【问题标题】:Android TOUCH_MOVE event not firing in avd or deviceAndroid TOUCH_MOVE 事件未在 avd 或设备中触发
【发布时间】:2010-09-30 04:09:20
【问题描述】:

事实上,只有touch_down 事件会触发。基本上,我正在尝试在我的应用程序中实现拖动功能,所以我需要touch_move 事件。我有一种方法可以在 Eclipse 中将触摸事件写入 LogCat,但 touch_down 是唯一出现的事件。甚至touch_up 都没有出现。我在设备或 avd 中调试时遇到此问题。

这不是一个真正的代码问题。但是有没有人在触发不同的触摸事件时遇到问题?如果是这样,您是如何解决它们的?我正在使用最新的 Android SDK 和 Eclipse 版本。我正在使用一个简单的 ImageView。

有什么想法吗?

【问题讨论】:

    标签: android events touch


    【解决方案1】:

    因此,在处理 TouchEvent 时,您需要小心。The important thing is that this event can have multiple actions that follow each other. So, if you return false when the down action event is received, you indicate that you have not consumed the event and are also not interested in subsequent actions from this event. Thus, you will not be called for any other actions within the event, such as a finger gesture, or the eventual up action event. 如需更多信息,请阅读documentation

    【讨论】:

    • 糟糕,我返回的是假的。一定是忽略了这一点。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-01
    • 2014-02-07
    • 2019-08-18
    • 2014-08-20
    • 1970-01-01
    • 2017-10-01
    • 1970-01-01
    相关资源
    最近更新 更多