开发者

How do i get the point/coordinate the user clicked on an android view?

开发者 https://www.devze.com 2023-01-15 16:31 出处:网络
I have an imageview and when clicked, calls OnClickLi开发者_StackOverflow中文版stener.onClick(View v). How do I get the exact point/coordinate that the user clicked?

I have an imageview and when clicked, calls OnClickLi开发者_StackOverflow中文版stener.onClick(View v). How do I get the exact point/coordinate that the user clicked?

Thanks


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消