popupWindow=new PopupWindow(MainActivity.this);
View popupView=getLayoutInflater().inflate(R.layout.selectedpopupwindow, null);
popupWindow.setContentView(popupView);
popupWindow.setWidth(LayoutParams.MATCH_PARENT);
popupWindow.setHeight(LayoutParams.MATCH_PARENT);
popupWindow.setBackgroundDrawable(new BitmapDrawable());
setBackgroundDrawable如果不设置这个弹出框会有点上移的感觉,
这里可以设置new BitmapDrawable(),也可以new ColorDrawable(),也可以直接null,就都不会有问题了,不知道具体是什么意思
popupWindow.setOutsideTouchable(true);
打开popupWindow.showAtPosition(XX,XX,X,X);
关闭popupWindow: popupWindow.dismiss();