我在这里使用另一个答案的代码:
AlertDialog.Builder adb = new AlertDialog.Builder(this);
Dialog d = adb.setView(new View(this)).create();
// (That new View is just there to have something inside the dialog that can grow big enough to cover the whole screen.)
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(d.getWindow().getAttributes());
lp.width = WindowManager.LayoutParams.FILL_PARENT;
lp.height = WindowManager.LayoutParams.FILL_PARENT;
d.show();
d.getWindow().setAttributes(lp);
我真的发现全屏制作 alertDialog 很有用,但颜色最终是带有白色文本的黑色背景,而不是带有黑色文本的白色背景。我不知道这段代码如何改变颜色。谁能提供一些信息?