Difference between MotionEvent.getRawX and MotionEvent.getX

时光怂恿深爱的人放手 提交于 2019-11-27 11:52:43

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

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

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

=>

rawX = motionEven.getX() + touchableButton.getX() + layout3.getX() + layout2.getX();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!