0

Hi, I know how to get the clicked position in screen .. my problem is I need to get the X and Y value of image where it clicked. It works fine if I have image size lesser then device but it goes wrong when using the large image.

I am Using horizontal and vertical scroll view to show the large image.

Using the event.getX() to get the position in the touch listener.

4

1 回答 1

0

要获取图像上的 X 和 Y 值,请将以下代码放入 OnTouchListener。

public boolean onTouch (View v, MotionEvent ev) 
{
    final int action = ev.getAction();

    final int evX = (int) ev.getX();
    final int evY = (int) ev.getY();
}   
于 2013-03-12T04:31:58.070 回答