private void showPopupWindow(View view){
popupWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT);
popupWindow.setBackgroundDrawable(new BitmapDrawable());
popupWindow.setFocusable(true);
popupWindow.setOutsideTouchable(true);
popupWindow.showAsDropDown(mChoose);
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
setAlpha(1.0f);
}
});
}
private void setAlpha(float f){
WindowManager.LayoutParams layoutParams = this.getWindow().getAttributes();
layoutParams.alpha = f;
this.getWindow().setAttributes(layoutParams);
}
就是这个