Android a simple way to remove the custom dialog white border

  • 2020-05-17 06:33:19
  • OfStack

Under the value directory, create the styles.xml file


<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style
        name="dialog"
        parent="@android:style/Theme.Dialog">
        <item name="android:windowFrame">@null</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowIsTranslucent">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:background">@android:color/black</item>
        <item name="android:windowBackground">@null</item>
        <item name="android:backgroundDimEnabled">false</item>
    </style>
</resources>

When instantiating dialog

ProgressDialog dialog = new ProgressDialog(ProgressBarActivity.this, R.style.dialog);

You don't have a white border.


Related articles: