我用的是Android4.0的系统:
PopupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.ic_launcher));
PopupWindow.setFocusable(true);
这两个之间是没有顺序的,且setFocusable这个方法必须设置为true。这样设置以后,当点击PopupWindow外部时,PopupWindow就会消失。
我用的是Android4.0的系统:
PopupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.ic_launcher));
PopupWindow.setFocusable(true);
这两个之间是没有顺序的,且setFocusable这个方法必须设置为true。这样设置以后,当点击PopupWindow外部时,PopupWindow就会消失。