600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > html5 datepicker ios iOS DatePicker日期时间选择器【组件】

html5 datepicker ios iOS DatePicker日期时间选择器【组件】

时间:2018-06-22 16:37:07

相关推荐

html5 datepicker ios iOS DatePicker日期时间选择器【组件】

日期时间选择,可根据需要设置样式类型:年月日时分、月日时分、年月日、月日、时分,限制最大时间、限制最小时间。

使用:

WSDatePickerView *datepicker = [[WSDatePickerView alloc] initWithDateStyle:DateStyleShowYearMonthDayHourMinute CompleteBlock:^(NSDate *startDate) {

NSString *date = [startDate stringWithFormat:@"yyyy-MM-dd HH:mm"];

NSLog(@"时间: %@",date);

[btn setTitle:date forState:UIControlStateNormal];

}];

datepicker.doneButtonColor = [UIColor purpleColor];//确定按钮的颜色

[datepicker show];

可设置的属性

@property (nonatomic,strong)UIColor *doneButtonColor;//按钮颜色

@property (nonatomic, retain) NSDate *maxLimitDate;//限制最大时间(默认9999-12-31 23:59)

@property (nonatomic, retain) NSDate *minLimitDate;//限制最小时间(默认 0-01-01 00:00)

弹框的类型

typedef enum{

DateStyleShowYearMonthDayHourMinute = 0, //年月日时分

DateStyleShowMonthDayHourMinute, //月日时分

DateStyleShowYearMonthDay, //年月日

DateStyleShowMonthDay, //月日

DateStyleShowHourMinute //时分

}WSDateStyle;

原作GitHub: /Zws-China/DatePicker

附上demo:alina_DatePicker_v1.0.1

转载时请注明出处及相应链接,本文永久地址:/20966.html

微信打赏

支付宝打赏

感谢您对作者Alina的打赏,我们会更加努力!如果您想成为作者,请点我

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。