我想使用 styles.xml
文件中的自定义样式自定义使用 MaterialAlertDialogBuilder
创建的 Material 警报对话框的标题、描述和按钮字体大小。但是,我不确定如何去创建这种风格。有人可以帮我解决这个问题吗? TIA
最佳答案
AlertDialog dialog = new MaterialAlertDialogBuilder(this)
.setMessage(description)
.setCancelable(false)
.setPositiveButton(R.string.ok, null)
.create();
dialog.show();
dialog.getButton(Dialog.BUTTON_POSITIVE).setTextSize(18);
TextView textView = dialog.findViewById(android.R.id.message);
if (textView != null) {
textView.setTextSize(18);
}
关于android - Material 对话框更改文本大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55794090/