方法一 ;在代碼中 可以這麼設置
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);