问题
I have an imageview and when clicked, calls OnClickListener.onClick(View v)
. How do I get the exact point/coordinate that the user clicked?
Thanks
回答1:
You can't get the coordinate touched in OnClickListerner. Please use OnTouchListener.onTouch(View v, MotionEvent event) instead of it, and you could get the coordinate from the event.
来源:https://stackoverflow.com/questions/3657243/how-do-i-get-the-point-coordinate-the-user-clicked-on-an-android-view