Android PopupWindow 問題。
問題描述
需求是點(diǎn)擊popupwindow 外部,popupwindow不消失。目前 Android 6.0 以下的系統(tǒng)均沒問題,但是6.0的系統(tǒng)上面點(diǎn)擊popupwindow外部以后popupwindow 消失。哪位大佬知道的說下哦。
同時(shí)一并問下6.0系統(tǒng)中使用 ContextCompat.checkSelfPermission 同時(shí)檢查 讀,寫聯(lián)系人權(quán)限如何實(shí)現(xiàn)?


問題解答
回答1:popupWindow.setFocusable(false);popupWindow.setTouchable(true);popupWindow.setBackgroundDrawable(new BitmapDrawable());popupWindow.setOutsideTouchable(false);popupWindow.update();
我試了下,貌似有效果
回答2:When window touchable is true, focusable is false,setOutsideTouchable() works.
pw.setTouchable(true); pw.setFocusable(false); pw.setOutsideTouchable(false);記得給我加分哦!!!thx!回答3:
檢查權(quán)限:讀權(quán)限:ContextCompat.checkSelfPermission(mContext, Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED;寫權(quán)限:ContextCompat.checkSelfPermission(mContext, Manifest.permission.WRITE_CONTACTS) == PackageManager.PERMISSION_GRANTED;判斷時(shí)添加&&用于判斷兩個(gè)條件是否return true請求權(quán)限:第一步:String[] permissions = {Manifest.permission.READ_CONTACTS,Manifest.permission.WRITE_CONTACTS}第二步:ActivityCompat.requestPermissions(activity, permissions,requestCode);
相關(guān)文章:
1. mac里的docker如何命令行開啟呢?2. 為什么我ping不通我的docker容器呢???3. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問題4. docker容器呢SSH為什么連不通呢?5. nignx - docker內(nèi)nginx 80端口被占用6. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””7. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問題。8. docker gitlab 如何git clone?9. docker 下面創(chuàng)建的IMAGE 他們的 ID 一樣?這個(gè)是怎么回事????10. docker-compose 為何找不到配置文件?

網(wǎng)公網(wǎng)安備