PopupWindow 真正 点击返回键,空白区域取消,返回键取消

来源:互联网 发布:统计分析软件市场规模 编辑:程序博客网 时间:2024/06/05 15:43
控制PopupWindow 是否能取消需要同时设置setOutsideTouchable和setFocusable方法,如下:

private void setCancelableInternal(boolean isCancelable) {
if (isCancelable) {
mPopupWindow.setOutsideTouchable(true);//点击空白键取消
mPopupWindow.setFocusable(true); //点击返回键取消
} else {
mPopupWindow.setOutsideTouchable(false);
mPopupWindow.setFocusable(false);
}
}
阅读全文
0 0
原创粉丝点击