popwindow 点击空白处不触发下面的控件的解决方案:

来源:互联网 发布:邓伦 知乎 编辑:程序博客网 时间:2024/05/18 00:23

popwindow 点击空白处不触发下面的控件的解决方案:

View popupWindow_view = getLayoutInflater().inflate(R.layout.mainleft,
null, false);
lineLeftXinyuan = (LinearLayout) popupWindow_view
.findViewById(R.id.line_mainleft_xinyuan);
txtModifyPwd = (TextView) popupWindow_view
.findViewById(R.id.txt_mainleft_modifypwd);
txtAboutus = (TextView) popupWindow_view
.findViewById(R.id.txt_mainleft_aboutus);
txtModifyPwd.setOnClickListener(this);
txtAboutus.setOnClickListener(this);
lineLeftXinyuan.setOnClickListener(this);
popLeft = new PopupWindow(popupWindow_view, LayoutParams.WRAP_CONTENT,
LayoutParams.MATCH_PARENT, true);
// 这里是位置显示方式,在屏幕的左侧
popLeft.setBackgroundDrawable(new BitmapDrawable());
popLeft.setFocusable(true);
popLeft.setOutsideTouchable(true);

popLeft.setAnimationStyle(R.style.popAnimation);
popLeft.showAtLocation(imgLoginIcon, Gravity.LEFT, 0, 0);

0 0
原创粉丝点击