<pre name="code" class="java">1.点击popwindow 以外的区域隐藏
使其聚焦
popupWindow.setFocusable(true);
设置允许在外点击消失
popupWindow.setOutsideTouchable(true);
2.点击"返回Back"也能使其消失,并且不会影响你的背景
popupWindow.setBackgroundDrawable(new BitmapDrawable());
3.点击popwindow自身的时候隐藏
popupWindow_view.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View arg0, MotionEvent arg1) {
if (popupWindow != null && popupWindow.isShowing()) {
popupWindow.dismiss();
return true;
}
return false;
}
});
popupWindow各种情况的隐藏方法
原创再见孙悟空_ 博主文章分类:【Android开发基础】 ©著作权
文章标签 popwindow popwindow隐藏 popwindow点击隐藏 java ide 文章分类 代码人生
-
SpringBoot隐藏的几个工具类
SpringBoot隐藏的几个工具类
SpringBoot 工具类