Popupwindow如果需要点击空白处自动消失,需要设置两个函数 1.customPopWindow.setFocusable(true);该函数也可以在构造函数中设置,如:mPopupWindow = new PopupWindow(popunwindwow,LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT,true);最后一个参数true即为设定Focusable属性. 2.customPopWindow.setBackgroundDr…