完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/DatePicker.html
DatePicker
public class DatePicker
extends FrameLayout
java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.FrameLayout | |||
↳ | android.widget.DatePicker |
Provides a widget for selecting a date.
一个选择日期的控件。
When the DatePicker_datePickerMode
attribute is set to spinner
, the date can be selected using year, month, and day spinners or a CalendarView
. The set of spinners and the calendar view are automatically synchronized. The client can customize whether only the spinners, or only the calendar view, or both to be displayed.
当DatePicker_datePickerMode
属性设置为spinner
时,可以使用年,月,日Spinner或CalendarView
来选择日期。这几个spinner和日历视图自动同步。使用者可以自定义是否只有spinner,或者只有日历视图,或者两者都显示。
When the DatePicker_datePickerMode
attribute is set to calendar
, the month and day can be selected using a calendar-style view while the year can be selected separately using a list.
当DatePicker_datePickerMode
属性设置为calendar
时,可以使用日历样式的视图来选择月份和日期,并使用一个列表来单独选择年份。
See the Pickers guide.
请参考Pickers。
For a dialog using this view, see DatePickerDialog
.
使用此视图的一个对话框,请参考DatePickerDialog
。
摘要
嵌套类 | |
---|---|
interface | DatePicker.OnDateChangedListener The callback used to indicate the user changed the date. |
XML属性 | |
---|---|
android:calendarTextColor | 日历列表的文本颜色。 |
android:calendarViewShown | 是否显示 "日历" 视图。 |
android:datePickerMode | 设定widget的外观。 |
android:dayOfWeekBackground | 头部标题上显示的一周的背景颜色。 |
android:dayOfWeekTextAppearance | 头部标题上显示的一周的文本颜色。 |
android:endYear | 最后一年 (包含), 例如 "2010"。 |
android:firstDayOfWeek | 设置Calendar 的一周的第一天。 |
android:headerBackground | 已选择日期的页眉的背景。 |
android:headerDayOfMonthTextAppearance | 选定日期页眉中月份日的文本外观。(例如:28) |
android:headerMonthTextAppearance | 选定日期页眉中月份的文本外观。(例如:五月) |
android:headerYearTextAppearance | 选定日期页眉中年份的文本外观。(如:2014)。 |
android:maxDate | 此日历视图显示的最大日期(mm/dd/yyyy格式)。 |
android:minDate | 此日历视图显示的最小日期(mm/dd/yyyy格式)。 |
android:spinnersShown | 是否显示spinner。 |
android:startYear | 第一年 (包含), 例如 "1940"。 |
android:yearListItemTextAppearance | 显示年的列表中的文本外观。 |
android:yearListSelectorColor | 显示年的列表中已被选择的项的外框的颜色。 |
继承XML属性
完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/DatePicker.html