Skip to content Skip to sidebar Skip to footer

Change The Style Of Alertdialog

When I run this code the alert dialog is shown but there is one white border around the dialog and also the borders are little round. I do not want this white border and I want to

Solution 1:

I found solution with the wrapper, where you can set a theme (style) to anything in the current context. I set R.style.MyTheme as style to my alert dialog and I customized that view to my own taste.

ContextThemeWrapperctw=newContextThemeWrapper( this, R.style.MyTheme );
        AlertDialog.Builder builder= newAlertDialog.Builder( ctw );

Solution 2:

You answered your question yourself but it did not work for me, so here's my answer hope to be helpful for everyone who need it:

<stylename="PauseDialog"parent="@android:style/Theme.Dialog"><itemname="android:windowNoTitle">true</item><itemname="android:windowBackground">@android:color/transparent</item></style>

Put this style in res\values\styles.xml file and just set the theme of your activity to it in your Manifest. Like this:

android:theme="@style/PauseDialog"

Post a Comment for "Change The Style Of Alertdialog"