简体   繁体   中英

custom date picker in ios

Im developing a app for iPad. The requirement of this app is to show a date picker having day + month + time + year.

UIDatePicker doesn't have this option. It only has Date & Time or Date or Time.

UIDatePicker *dtPicker  = [UIDatePicker alloc] init];
dtPicker.mode = UIDatePickerMode - UIDatePickerModeTime /     UIDatePickerModeDate / UIDatePickerModeDateAndTime  

Is there any picker with all three combined?

No way to do this using UIDatePicker .

Suggestion:

You can use a Customized UIPickerView to do this.

Create a picker with 4 fields and manipulate them with 4 arrays with corresponding values. (You need to do the validating stuffs and other things)

You can use this to customize your data picker: IXPickerOverlayView

In github repo you can find example, sources and resources.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM