1.
View view = inflater.inflate(R.layout.popwindowdemo, null);
final PopupWindow pop = new PopupWindow(view, 600, 800);
pop.setBackgroundDrawable(new BitmapDrawable());
pop.setFocusable(true);// 如果不加这个,Grid不会响应ItemClick
pop.showAtLocation(layout, Gravity.CENTER, 0, 0);
这里我提一点,点击外部消失关键性一步是pop.setBackgroundDrawable(new BitmapDrawable());
我之前把这句话写在pop.showAtLocation()之后;也无法显示