You can create a custom dialog box and make it as you want.
Yes you can change your Dialog box as you want.You can do this by creating a custom dialog box.
Step1.Create a style in String file in res
<style name="myQuitDialog" parent="android:Theme.Dialog">
<item name="android:gravity">center_horizontal</item>
</style>
步骤2 在布局中创建 xml 文件
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_quit"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/image which u want to show"
>
步骤3. 在 src 中写入自定义对话框的代码
class Custom_Dialog extends Dialog {
protected Custom_Dialog(Context context, int theme) {
super(context, theme);
// TODO Auto-generated constructor stub
}
}
private void show_alert() {
final Custom_Dialog alertbox = new Custom_Dialog(this, R.style.myQuitDialog);
Window window = alertbox.getWindow();
window.setBackgroundDrawableResource(android.R.color.transparent);
window.requestFeature(window.FEATURE_NO_TITLE);
alertbox.show();
alertbox.setCancelable(true);
alertbox.setCanceledOnTouchOutside(true);
alertbox.dismiss();
}
}
这就是你需要的 如果你觉得它满足你,就接受它