共用方式為


MotionEvent.GetY Method

Definition

Overloads

GetY()

Equivalent to #getY(int) for pointer index 0 (regardless of the pointer identifier).

GetY(Int32)

Returns the Y coordinate of the pointer referenced by pointerIndex for this motion event.

GetY()

Equivalent to #getY(int) for pointer index 0 (regardless of the pointer identifier).

[Android.Runtime.Register("getY", "()F", "")]
public float GetY ();
[<Android.Runtime.Register("getY", "()F", "")>]
member this.GetY : unit -> single

Returns

The Y coordinate of the first pointer index in the coordinate space of the view that received this motion event.

Attributes

Remarks

Equivalent to #getY(int) for pointer index 0 (regardless of the pointer identifier).

Java documentation for android.view.MotionEvent.getY().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetY(Int32)

Returns the Y coordinate of the pointer referenced by pointerIndex for this motion event.

[Android.Runtime.Register("getY", "(I)F", "")]
public float GetY (int pointerIndex);
[<Android.Runtime.Register("getY", "(I)F", "")>]
member this.GetY : int -> single

Parameters

pointerIndex
Int32

Index of the pointer for which the Y coordinate is returned. May be a value in the range of 0 (the first pointer that is down) to #getPointerCount() - 1.

Returns

The Y coordinate of the pointer referenced by pointerIndex for this motion event. The unit is pixels. The value may contain a fractional portion for devices that are subpixel precise.

Attributes

Remarks

Returns the Y coordinate of the pointer referenced by pointerIndex for this motion event. The coordinate is in the coordinate space of the view that received this motion event.

Use #getPointerId(int) to get the pointer identifier for the pointer referenced by pointerIndex.

Java documentation for android.view.MotionEvent.getY(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to