2

我最近刚刚将我的个人手机更新到 Android 4.0.4。这样做,我注意到DatePickerDialog我在应用程序中显示的不再像以前的版本那样在标题栏中显示长日期格式:

在此处输入图像描述

相反,它只是说:“设置日期”。

那么,有没有一种快速的方法可以让它DatePickerDialog总是在标题栏中显示长日期?或者这是我必须通过创建自己的自定义来克服的版本限制Dialog

4

1 回答 1

2

So, is there a quick way to make it so that this particular DatePickerDialog always display the long date in the title bar ?

The former update-the-title logic is completely removed from the current DatePickerDialog source code. You should be able to extend DatePickerDialog and override onDateChanged() (and the six-parameter constructor) to restore this functionality, at least in theory -- I have never tried this.

FWIW, here is a link to an older version of DatePickerDialog that had the update-the-title logic.

于 2012-04-19T20:17:13.307 回答