通过非xml编码更改android中datepicker对话框的字体
如何通过在android中编码而不是在xml文件中更改日期选择器对话框的字体 我的代码在下面通过非xml编码更改android中datepicker对话框的字体,android,Android,如何通过在android中编码而不是在xml文件中更改日期选择器对话框的字体 我的代码在下面 public void select_date() { DatePickerDialog dialog = new DatePickerDialog(Get_a_Quote.this.getParent(), dateset, Integer.parseInt(DateFormat .format("yyyy
public void select_date() {
DatePickerDialog dialog = new DatePickerDialog(Get_a_Quote.this.getParent(),
dateset, Integer.parseInt(DateFormat
.format("yyyy", cal).toString()), cal
.get(Calendar.MONTH), cal
.get(Calendar.DAY_OF_MONTH));
dialog.show();
}
这对我有用
<style name="DatePickerDialogTheme" parent="Theme.MaterialComponents.Light.Dialog.Alert">
<item name="colorAccent">@color/colorAccent</item>
<item name="android:fontFamily">@font/roboto</item>
<item name="android:datePickerStyle">@font/roboto</item>
</style>
@颜色/颜色重音
@字体/机器人
@字体/机器人
希望这对你也有帮助