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

方法一 ;在代码中 可以这么设置
                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);

猜你喜欢

转载自blog.csdn.net/qq_25749749/article/details/80747020