我想知道,当同时触摸屏幕上的点时,可以获得两组正确的坐标点。 如果是,那么如何使用它。谷歌搜索但没有得到任何满意的结果。请帮忙吗?
答案 0 :(得分:0)
使用以下两种方法代替getX和getY:
public final float getX (int pointerIndex)
Since: API Level 5
Returns the X coordinate of this event for the given pointer index (use getPointerId(int) to find the pointer identifier for this index). Whole numbers are pixels; the value may have a fraction for input devices that are sub-pixel precise.
public final float getY (int pointerIndex)
Since: API Level 5
Returns the Y coordinate of this event for the given pointer index (use getPointerId(int) to find the pointer identifier for this index). Whole numbers are pixels; the value may have a fraction for input devices that are sub-pixel precise.
Parameters
pointerIndex Raw index of pointer to retrieve. Value may be from 0 (the first pointer that is down) to getPointerCount()-1.