2013-10-21 70 views
0

我創建了自定義進度對話框可繪製。刪除自定義進度對話邊框

<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

回答

4

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

+0

感謝@MrSuS,它的工作原理 – kaibuki

2

您需要添加以下到您的CustomAlertDialogStyle太:

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