[英]How to dismiss the PopupWindow on touching outside area of it?
我已經搜索過了。 但是,沒有一個解決方案有效。
PopupWindow已設置,我唯一想發生的事情是當我在彈出窗口之外單擊時,它應該被關閉或取消。
嘗試
progressDialog.setCanceledOnTouchOutside(true);
您應該使用setOutsideTouchable
調用的參數添加為true來添加此函數:
pw = new PopupWindow(getApplicationContext());
pw.setOutsideTouchable(true);
希望它將為您服務
popupWindow.setOutsideTouchable(true);
popupWindow.setBackgroundDrawable(getResources().getDrawable(R.id.something));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.