Android Study Notes (28): Analysis of Three selector DatePicker_TimePicker_NumberPicker
Both DatePicker and TimePicker are derived from FrameLayout and used to select a date and a time.
Use the OnDateChangedListener () method and the OnTimeChangedListener () method to bind the event listener.
Common XML attributes of DatePicker
XML attributes |
Description |
Android: calendarViewShown |
Sets whether the date selector displays the CalendarView attribute. |
Android: endYear |
Set the last year allowed by the date Selector |
Android: maxDate |
Set the supported maximum date, and specify the maximum date in mm/dd/yyyy format |
Android: minDate |
Set the supported minimum date, and specify the minimum date in mm/dd/yyyy format |
Android: spinnersShown |
Sets whether the date selector displays the Spinner date Selection Component. |
Android: startYear |
Set the first year allowed by the date Selector |
TimePicker is similar.
NumberPicker value Selector
Common Methods:
SetMinValue (intminVal): sets the minimum value supported by this component.
SetMaxValue (intmaxVal): sets the maximum value supported by this component.
SetValue (intvalue): sets the current value of the component.