创建具有暗灰色背景的对话框

时间:2021-04-14 18:55:04

I've created a Dialog that appears when a button is clicked. I made a custom layout for it and coded it like this:

我创建了一个单击按钮时出现的对话框。我为它做了一个自定义布局并将其编码为:

final Dialog dialog = new Dialog (CheckpointsActivity.this, android.R.style.Theme_Translucent);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.alert_continue);
//rest of the code...

This is how the Dialog looks now: 创建具有暗灰色背景的对话框

这就是Dialog现在的样子:

And this is how I want it to look like:

这就是我希望它看起来像:

创建具有暗灰色背景的对话框

It should be a lot darker in the background with a gradient effect. I can't seem to find any info on how to achieve this.

在背景中它应该是更暗的渐变效果。我似乎无法找到有关如何实现这一目标的任何信息。

1 个解决方案

#1


0  

You can make a dialog box with the same background and gradient and then make the ui on top of that.

您可以创建一个具有相同背景和渐变的对话框,然后在其上面创建ui。

#1


0  

You can make a dialog box with the same background and gradient and then make the ui on top of that.

您可以创建一个具有相同背景和渐变的对话框,然后在其上面创建ui。