java - Android MotionEvent 等同于 Java MouseEvent?

标签 java android events mouseevent

我想知道 Android 中的 MotionEvent 是否等同于 Java 中的 MouseEvent

我试图做的就是获取 xy 坐标并检查它们是否在我的 View 中。 (我注意到 MotionEvent 有 x 和 y 的 setter/getter )

最佳答案

All I'm attempting to do is get the x and y coordinates and check if they are inside my View.

MotionEvent 是实现此目的的正确方法。

I'm wondering if MotionEvent in Android is equivalent to MouseEvent in Java?

它们几乎相同,尽管 MotionEvent 用于触摸,但我想您已经明白了。

关于java - Android MotionEvent 等同于 Java MouseEvent?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6782578/

相关文章:

Java 监听器继承

javascript - 在暂停/重置其他音频的同时播放选定的音频

java - Maven/Spring boot项目-如何跳过@SpringBootTest

c# - 扫描 Wifi 网络不会返回 Xamarin 代码中的值

android - 方向变化增加了 TextView 的文本大小

android - 如何创建 Android Market 链接以列出开发人员的所有应用程序?

Java Swing/EDT 事件处理同步

java - 测试方法接受其他子类作为参数

java - 如何锁定单个 ConcurrentHashMap 对象进行修改而不阻塞整个映射?

c# - 为什么默认情况下 Switch 语句的 Fall-Through?