久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

Android PopupWindow 問題。

瀏覽:117日期:2024-08-27 17:04:50

問題描述

需求是點(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)?

Android PopupWindow 問題。

Android PopupWindow 問題。

問題解答

回答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請(qǐng)求權(quán)限:第一步:String[] permissions = {Manifest.permission.READ_CONTACTS,Manifest.permission.WRITE_CONTACTS}第二步:ActivityCompat.requestPermissions(activity, permissions,requestCode);

相關(guān)文章:
主站蜘蛛池模板: 梧州市| 洛扎县| 乳源| 定安县| 瓦房店市| 铜山县| 莒南县| 明光市| 泗阳县| 灵石县| 修文县| 双城市| 革吉县| 梅河口市| 梁平县| 通道| 荥阳市| 边坝县| 延吉市| 洛川县| 平阳县| 米易县| 自贡市| 延川县| 洱源县| 肃北| 南宫市| 太仆寺旗| 虹口区| 江山市| 娱乐| 平顺县| 贡山| 木里| 屏山县| 阳新县| 临猗县| 延边| 南宁市| 宝山区| 德保县|