Android Material Design 内联日期选择器问题 [英] Android Material Design Inline Datepicker issue
问题描述
我有一个带有日期选择器的 ScrollView
I have a ScrollView
with a Datepicker
在以前的 Android 版本中,Datepicker 是这样的:
In the previous versions of Android the Datepicker is this:
而且我可以毫无问题地滚动 Datepicker 日、月、年的单个元素
And I can scroll the single elements of Datepicker day, month, years without problems
在 Android Lollipop API level 21 Material 中,Datepiker 是这样显示的:
In Android Lollipop API level 21 Material, the Datepiker is shown in this way:
如果我点击月份会显示日历视图并且我无法更改月份,我只能选择日期.如果我尝试编辑年份会显示一个年份滚动条,但是如果我尝试 tro 滚动它,则会滚动包含日期选择器的整个布局,而不仅仅是日期.
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
似乎被忽略了
我该如何解决这个问题???
How could I fix this issue???
推荐答案
calendarViewShown
属性在日历样式的日期选择器中已弃用.如果您想要回旋器样式的日期选择器,您可以将 datePickerMode
属性设置为 spinner
.
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.
这篇关于Android Material Design 内联日期选择器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!