Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何更改对话框字体?_Android_Android Alertdialog - Fatal编程技术网

Android 如何更改对话框字体?

Android 如何更改对话框字体?,android,android-alertdialog,Android,Android Alertdialog,我需要在不设置自定义布局的情况下更改消息文本视图的字体和警报对话框的标题文本视图,如何实现它?试试这个 AlertDialog dialog = new AlertDialog.Builder(this).setMessage("Hello world").show(); TextView textView = (TextView) dialog.findViewById(android.R.id.message); 现在您收到了消息TextView,请执行您可以执行的任何操作

我需要在不设置自定义布局的情况下更改消息文本视图的字体和警报对话框的标题文本视图,如何实现它?

试试这个

AlertDialog dialog = new AlertDialog.Builder(this).setMessage("Hello world").show();
TextView textView = (TextView) dialog.findViewById(android.R.id.message);
现在您收到了消息TextView,请执行您可以执行的任何操作