1

I want to make two skin application and fast change background in dialogs. I have DialogFragments and when i want to display my own theme i do it by:

    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.MyDialog);

And in styles.xml i have:

<style name="MyDialog" parent="@android:style/Theme.Holo.Dialog">
    <item name="android:background">@color/background_black</item>
    <item name="android:windowBackground">@null</item>
    <item name="android:windowFrame">@null</item>
</style>

but it's doesn't works. How to remove that second background selected here: http://i62.tinypic.com/2i29dzr.png background between yellow lines

uni
  • 46
  • 6

1 Answers1

3

As for me I'm using this style to remove background of dialog, and it works for me perfectly:

<style name="CustomDialog" parent="@android:style/Theme.Holo.Dialog">
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
    <item name="android:background">@android:color/transparent</item>
    <item name="background">@android:color/transparent</item>
</style>
romtsn
  • 11,704
  • 2
  • 31
  • 49
  • It works without 4th item, but how to change background color of buttons and text above button? – uni Apr 17 '15 at 09:38
  • Check this http://stackoverflow.com/a/15022647/3225458 solution, maybe it will be helpful. – romtsn Apr 17 '15 at 10:11