简体   繁体   English

ios中的自定义日期选择器

[英]custom date picker in ios

Im developing a app for iPad. 我正在为iPad开发应用程序。 The requirement of this app is to show a date picker having day + month + time + year. 此应用程序的要求是显示日期+月份+时间+年份的日期选择器。

UIDatePicker doesn't have this option. UIDatePicker没有此选项。 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 . 无法使用UIDatePicker执行此操作。

Suggestion: 建议:

You can use a Customized UIPickerView to do this. 您可以使用自定义UIPickerView执行此操作。

Create a picker with 4 fields and manipulate them with 4 arrays with corresponding values. 创建一个包含4个字段的选择器,并使用4个具有相应值的数组对其进行操作。 (You need to do the validating stuffs and other things) (你需要做验证的东西和其他东西)

You can use this to customize your data picker: IXPickerOverlayView 您可以使用它来自定义数据选择器: IXPickerOverlayView

In github repo you can find example, sources and resources. 在github repo中,您可以找到示例,来源和资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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