日期选择器的 Android 日历视图 [英] Android Calendar View for Date Picker
问题描述
我正在编写我的第一个应用程序,我有一个关于 DatePicker
的问题.
I'm writing my first app, and I have a question about DatePicker
.
我的应用要求用户输入日期.最用户友好的方式是弹出一个类似日历的小部件,该小部件像日历网格一样显示当前月份 - 如下所示:
My app requires the user to input a date. The most user-friendly way would be to popup a calendar-like widget that displays the current month like a calendar grid - something like this:
我想用它来代替 DatePicker
界面 - 它有月、日和年字段,每个字段都有一个向上和向下按钮来增加/减少.
I want to use that in place of the DatePicker
interface - which has Month, Day, and Year fields, each with an up and down button to increment/decrement.
这种类型的功能是否内置在任何 Android 小部件或视图中,还是我必须设计自己的自定义组件才能做到这一点?我想这已经存在了,看看这种类型的 UI 在非移动应用程序和网页中的使用如此频繁.
Is this type of functionality built into any Android widget or view, or would I have to design my own custom component to do this? I figured this would already exist, seeing how much this type of UI is used so frequently in non-mobile apps and web pages.
谢谢!
推荐答案
这种类型的功能是否内置在任何 android 小部件或视图中,还是我必须设计自己的自定义 > 组件才能做到这一点?
Is this type of functionality built into any android widget or view, or would I have to design my own custom > component to do this?
Android SDK 中没有相应的组件,抱歉.您说明的小部件对于触摸屏来说太小了.您可以实现更大的东西(请参阅日历应用程序),但您在很大程度上要靠自己.
There is no component for that in the Android SDK, sorry. The widget you illustrate is too small for a touchscreen. You can implement something larger (see the Calendar app), but you are largely on your own for that.
这篇关于日期选择器的 Android 日历视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!