DatePicker include Year

蓝咒 提交于 2019-12-04 04:37:37
Robert Harvey
datePicker.datePickerMode = UIDatePickerModeDate;

UIDatePickerModeDate

The date picker displays months, days of the month, and years. The exact order of these items depends on the locale setting. An example of this mode is [ November | 15 | 2007 ].

Available in iOS 2.0 and later.

Declared in UIDatePicker.h.

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIDatePicker_Class/Reference/UIDatePicker.html

Also you can change from storyboard set Mode: (Refer to screenshot)

If you want to add month, date, year as well as time, add one picker that implements the dates only using (UIDatePickerModeDate) and an additional one for the time (UIDatePickerModeTime).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!