uni
uni

Reputation: 46

How to remove second background under DialogFragment with own style

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

Upvotes: 1

Views: 895

Answers (1)

romtsn
romtsn

Reputation: 11982

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>

Upvotes: 3

Related Questions