Android的材料设计内嵌日期选择器问题 [英] Android Material Design Inline Datepicker issue

查看:615
本文介绍了Android的材料设计内嵌日期选择器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个滚动型用日期选择器

在Android中的previous版本的日期选择器是这样的:

In the previous versions of Android the Datepicker is this:

和我可以滚动的日期选择日,月,年的单一元素没有问题

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

在Android的棒棒糖API级别21材质,Datepiker显示以这种方式:

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

似乎忽略

我怎么能解决这个问题???

How could I fix this issue???

推荐答案

calendarViewShown 属性pcated日历式日期选择器去$ P $。如果你想微调式的日期选择器回来,你可以设置 datePickerMode 属性微调

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的材料设计内嵌日期选择器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆