0
我必须显示一个popup窗口。如果我在ImageView的单击事件中显示它,那么我称它为隐藏它。但是,当我在ImageView的Touch事件中显示它时,请关闭事件调用,但弹出窗口不会隐藏。这个错误的原因是什么?我如何解决它?PopUpWindow解雇问题
我用来显示弹出窗口的代码是
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels; //320
CabotMessageHandler.printConsole("width of screen"+width);
//show Popup
LayoutInflater inflater = (LayoutInflater)
this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
popupView=inflater.inflate(R.layout.gallerytoppopup, null, false);
pw = new PopupWindow(
popupView,
width,
30,
true);
// The code below assumes that the root container has an id called 'main'
pw.setAnimationStyle(R.anim.popupanimation);
pw.showAtLocation(this.findViewById(R.id.webview), Gravity.TOP, 0, 30);