DatePickerDialog display year picker first

前提是你 提交于 2019-12-03 11:22:33

Using the Datepicker XML modifications you can elect to show spinners instead of the Calendar, which might be beneficial for you as you want to directly edit the years.

android:datePickerMode="spinner"

Same as Show year selection first in Android Calendar View

I will copy here my answer:

You can get a reference to year view and then just simulate user click to open it.

dataPicker.getTouchables().get( 0 ).performClick();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!