0
点赞
收藏
分享

微信扫一扫

如何使Android dialog弹出后当前的 activity背景不变暗

吃面多放酱 2022-02-21 阅读 51
androidxml


方法一 ;在代码中 可以这么设置

                Window mWindow = getWindow();  

                   WindowManager.LayoutParams lp = mWindow.getAttributes();  

                        lp.dimAmount =0f;

方法二:在style 的xml 里 设置如下


<resources>


    <style name="dialog" parent="@android:style/Theme.Dialog">


        <item name="android:backgroundDimEnabled">false</item><!--activity不变暗-->


    </style>


</resources>


设置为true, 背景变暗


Dialog = new Dialog(Activity, R.style.dialog);


举报

相关推荐

0 条评论