Android Study Notes (28): Analysis of Three selector DatePicker_TimePicker_NumberPicker

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.