2014-02-11 35 views

回答

0

試試這個,

int[] location = new int[2]; // must be array of two integer. 

view.getLocationOnScreen(location); 

xAxis = location[0]; // 

yAxis = location[1]; 
0

嘗試 使用View.getLocationOnScreen()getLocationInWindow()

例如:

 int loc[] = { 0, 0 }; 
     View.getLocationOnScreen(loc); 
     int x = loc[0]; // x position 
     int y = loc[1]; // y position 
相關問題