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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…