取得View在屏幕上的位置
获得View在屏幕上的位置
android.view.View
Computes the coordinates of this view on the screen. The argument must be an array of two integers. After the method returns, the array contains the x and y location in that order.
public void getLocationOnScreen (int[] location)
Since: API Level 1
Parameters
location
an array of two integers in which to hold the coordinates