2014-11-25 38 views

回答

4

我最終使用下列內容:

int[] location = new int[2];  
popupWindow.getContentView(). getLocationOnScreen(location); 
0
Rect rc = new Rect(); 
View.getWindowVisibleDisplayFrame(rc); 
int[] xy = new int[2]; 
View.getLocationInWindow(xy); 
rc.offset(xy[0], xy[1]); 

現在你有

inx x = rc.left, y = rc.top;