In my application i am using alert dialog with rounded rectangle theme.But it have alertdialog rectangle and my theme.My problem is how to replace alert dialog border like dialog.I want to show this set item with own theme only.
I want output this manner instead of the above theme:
Main Activity:
AlertDialog.Builder alertSeverity = new AlertDialog.Builder(
getActivity(), R.style.Theme_CustomDialog);
alertSeverity.setTitle("Severity Status");
CharSequence[] severityStatus = { "Low-Severity",
"Middle-Severity", "High-Severity" };
alertSeverity.setItems(severityStatus,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
My Theme:
<style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/shapedialogtheme</item>
<item name="android:windowFrame">@null</item>
</style>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#565656" />
<stroke
android:width="5dp"
android:color="#ffff8080" />
<corners android:radius="30dp" />
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" />
<size
android:width="150dp"
android:height="150dp"/>
</shape>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…