popupWindow的弹窗在正上方

int[] location  = new int[2];
                        getLocationInWindow(location);
                        int x  = location[0];
                        int y = location[1];
                        //显示在popupwindow的正上方
                        popupWindow.showAtLocation(MySpinner.this, Gravity.TOP|Gravity.LEFT, x,y);

你可能感兴趣的:(4,android,应用,系统开发)