Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Holo Dialog has 2 backgrounds layered on top of one another

Tags:

android

enter image description here

The dialog looks like this. There is a layer behind the dialog itself about 10-20 pixels or so on each side. The theme I am using is Theme.Holo.Dialog

I tried creating a custom dialog with a transparent background, but that did not work:

<style name="CustomHoloDialog" parent="@android:style/Theme.Holo.Dialog">
     <item name="android:background">@android:color/transparent</item>
</style>

Does anyone have any ideas on this?

like image 674
JMRboosties Avatar asked Feb 28 '13 00:02

JMRboosties


1 Answers

If you want to style a Dialog then you have to use a ContextThemeWrapper:

AlertDialog.Builder mBuilder = new AlertDialog.Builder(new ContextThemeWrapper(context, android.R.style.Theme_Holo_Dialog));
like image 193
Ahmad Avatar answered Oct 18 '22 20:10

Ahmad