我想知道当屏幕同时触摸到屏幕上的点时,是否可以获得两组正确的坐标点。如果是,那么如何使用它。谷歌搜索但没有得到任何满意的结果。请帮忙?
问问题
1573 次
1 回答
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.
于 2012-09-07T11:53:40.207 回答