Android Material Design Inline Datepicker issue

空扰寡人 提交于 2019-11-26 19:08:33

问题


I have a ScrollView with a Datepicker

In the previous versions of Android the Datepicker is this:

And I can scroll the single elements of Datepicker day, month, years without problems

In Android Lollipop API level 21 Material, the Datepiker is shown in this way:

If I click on the month is shown a calendar view and I cannot change the month, I can only select the day. If I try to edit the year is shown a year scroller, but If I try tro scroll it, the whole layout where datepicker is contained is scrolled, not only the date.

calendarViewShown=false

seems ignored

How could I fix this issue???


回答1:


The calendarViewShown attribute is deprecated in the calendar-style date picker. If you want the spinner-style date picker back, you can set the datePickerMode attribute to spinner.

<DatePicker
    ...
    android:datePickerMode="spinner" />

As for the scrolling issue, the calendar-style date picker doesn't support nested scrolling.



来源:https://stackoverflow.com/questions/26854762/android-material-design-inline-datepicker-issue

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