JMRboosties
JMRboosties

Reputation: 15740

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

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?

Upvotes: 11

Views: 2599

Answers (1)

Ahmad
Ahmad

Reputation: 72603

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));

Upvotes: 21

Related Questions