MotionEvent.getRawX和MotionEvent.getX的区别 [英] Difference between MotionEvent.getRawX and MotionEvent.getX

查看:156
本文介绍了MotionEvent.getRawX和MotionEvent.getX的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道的区别 MotionEvent.getRawX MotionEvent.getX 在Android作为一个是数字另一个是浮?请告诉我需要有这两种类型的?

I would like to know The difference between MotionEvent.getRawX and MotionEvent.getX in android as one is numeric and the other is float?Whats the need to have both of these types?

推荐答案

MotionEvent 有时会返回绝对X和相对的Y坐标,有时相对坐标为previous运动盛会。

MotionEvent will sometimes return absolute X and Y coordinates relative to the view, and sometimes relative coordinates to the previous motion event.

getRawX() getRawY()这是保证返回绝对坐标,相对于设备屏幕。

getRawX() and getRawY() that is guaranteed to return absolute coordinates, relative to the device screen.

的getX() getY()以,应该返回你的坐标,​​相对于视图,分派它们。

While getX() and getY(), should return you coordinates, relative to the View, that dispatched them.

这篇关于MotionEvent.getRawX和MotionEvent.getX的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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