【发布时间】:2020-06-21 19:40:21
【问题描述】:
虽然我尝试了以下代码,但无论如何我都无法更改警报对话框的颜色。
Java:
private void showAlertDialog(String title, String message){
AlertDialog.Builder builder = new AlertDialog.Builder(RegisterActivity.this, R.style.AlertDialogTheme);
builder.setTitle(title);
builder.setMessage(message);
builder.setPositiveButton("Tamam", null);
builder.show();
}
XML:
<style name="AlertDialogTheme" parent="Theme.AppCompat.Dialog.Alert">
<!--item name="android:background">@color/google_orange</item-->
<item name="colorPrimary">@color/google_orange</item>
<item name="buttonBarPositiveButtonStyle">@color/google_orange</item>
<item name="colorButtonNormal">@color/google_orange</item>
<item name="colorError">@color/google_orange</item>
<item name="colorAccent">@color/google_orange</item>
</style>
【问题讨论】:
标签: android xml button colors android-alertdialog