对话框有圆角但不是透明边

jca*_*uso 1 android dialog

我有下面的对话框显示在我的应用程序上......正如你所看到的,我有我想要的圆角,但我想删除黑色的透明边缘.

这是对话框的样式xml和图像:

<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android" android:insetBottom="-1dp">
    <shape android:shape="rectangle">
        <solid android:color="@color/base" />
        <corners android:topLeftRadius="20dp" 
            android:topRightRadius="20dp"
            android:bottomRightRadius="20dp"
            android:bottomLeftRadius="20dp" />
        <stroke android:color="#7F7F7F" 
                android:width="1dp" />
    </shape>
</inset>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

dha*_*rms 5

尝试使用

dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
Run Code Online (Sandbox Code Playgroud)