如何在日期时间选择器对话框中更改日期的文本大小?

时间:2019-05-27 14:44:48

标签: java android datetimepicker android-datepicker datepickerdialog

我的项目中有date time picker dialogdialog的大小适合手机。但是,对于平板电脑屏幕来说很小。我为平板电脑屏幕做了特殊的style.xml,并且成功地放大了buttonfont size of button。但是,我无法成功更改text size天。我该怎么办?

https://ftuforum.com/interactive-python-dashboards-with-plotly-and-dash

 public Dialog onCreateDialog(Bundle savedInstanceState) {
    boolean tabletSize = getResources().getBoolean(R.bool.isTablet);
    if (tabletSize) {
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH);
        int day = calendar.get(Calendar.DAY_OF_MONTH);


        DatePickerDialog datePickerDialog = new DatePickerDialog(getActivity(), R.style.date_time_picker, this, year, month, day);
     datePickerDialog.getWindow().setBackgroundDrawableResource(R.drawable.dialog_corner);
        return datePickerDialog;
    }

sw600dp / styles.xml

  <style name="date_time_picker">
    <item name="android:windowIsFloating">true</item>
    <item name="android:textSize">28sp</item>
</style>

0 个答案:

没有答案