删除自定义进度对话框边框

时间:2013-10-21 08:14:38

标签: android progress-bar border customization progressdialog

我创建了一个自定义进度对话框drawables。

 <style name="MyTheme" parent="@android:style/Theme.Dialog">
        <item name="android:alertDialogStyle">@style/CustomAlertDialogStyle</item>
        <item name="android:textColorPrimary">#ABCDEF</item>
        <item name="android:textColor"> @color/heading</item>
        <item name="android:background">#00000000</item>
         <item name="android:windowFrame">@null</item>

    </style>

    <style name="CustomAlertDialogStyle">
         <item name="android:background">#00000000</item>
      <item name="android:windowFrame">@null</item>
        <item name="android:bottomBright">@color/grey</item>
        <item name="android:bottomDark">@color/grey</item>
        <item name="android:bottomMedium">@color/grey</item>
        <item name="android:centerBright">@color/grey</item>
        <item name="android:centerDark">@color/grey</item>
        <item name="android:centerMedium">@color/grey</item>
        <item name="android:fullBright">@color/grey</item>
        <item name="android:fullDark">@color/grey</item>
        <item name="android:topBright">@color/grey</item>
        <item name="android:topDark">@color/grey</item>
    </style>

一切都很好,它展示了应有的东西。但对话框显示边框。我想删除那些边框[附加屏幕截图]。

enter image description here

2 个答案:

答案 0 :(得分:4)

使用dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);

答案 1 :(得分:2)

您还需要将以下内容添加到CustomAlertDialogStyle

<item name="android:windowBackground">@android:color/transparent</item>