getGlobalVisibleRect , 獲取全局坐標系的一個視圖區域, 返回一個填充的Rect對象;該Rect是基於總整個屏幕的
getLocationOnScreen ,計算該視圖在全局坐標系中的x,y值,(注意這個值是要從屏幕頂端算起,也就是索包括了通知欄的高度)//獲取在當前屏幕內的絕對坐標
getLocationInWindow ,計算該視圖在它所在的widnow的坐標x,y值,//獲取在整個窗口內的絕對坐標 (不是很理解= =、)
getLeft , getTop, getBottom, getRight, 這一組是獲取相對在它父親里的坐標
**注**:如果在Activity的OnCreate()事件輸出那些參數,是全為0,要等UI控件都加載完了才能獲取到這些
example:
int[] location = new int[2];
v.getLocationOnScreen(location);
int x = location[0];
int y = location[1];