【问题标题】:Date is shown twice if setMaxDate is used on DatePickerDialog如果在 DatePickerDialog 上使用 setMaxDate,则日期显示两次
【发布时间】:2017-12-30 03:04:27
【问题描述】:

在这样的日期选择器对话框中设置最大日期时:

DatePickerDialog dialog = new DatePickerDialog(this, listener, year, month, day);
dialog.getDatePicker().setMaxDate(new Date().getTime());

日期正常显示,但在对话框顶部也会第二次显示。我看到很多人都遇到过这个错误,但我没有找到解决方案。

你也可以在this image from another user看到它

除了使用反射之外,还有什么方法可以防止或解决这个问题?

【问题讨论】:

    标签: android datepickerdialog


    【解决方案1】:

    我通过在每次设置最大日期时调用dialog.setTitle(null) 解决了这个错误。

    我在这里发布了这个问题:https://issuetracker.google.com/72284741

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-10
      • 1970-01-01
      • 2015-12-19
      • 1970-01-01
      相关资源
      最近更新 更多