属性
- 创建
UIDatePicker *picker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 200)];
- local 地区地区语言(默认当前地区)
picker.locale = [NSLocale currentLocale];
- datePickerMode 选择器类型
UIDatePickerModeTime 显示小时、分钟和可选的AM/PM
UIDatePickerModeDate 显示月、日、年
UIDatePickerModeDateAndTime 显示日期、小时、分钟和可选的AM/PM
UIDatePickerModeCountDownTimer 显示小时和分钟
- locale 地区(默认当前地区)
picker.locale = [NSLocale currentLocale];
- calendar 日历(默认当前日期)
picker.calendar = [NSCalendar currentCalendar];
- timeZone 时区(默认nil)
picker.timeZone = nil;
- date 时间(默认当前时间)
picker.date = [NSDate date];
- minimumDate 最小时间
picker.minimumDate = date;
- maximumDate 最大时间
picker.maximumDate = date;
- minuteInterval 时间间隔
picker.minuteInterval = 3;
- countDownDuration 倒计时剩余时间
leftSeconds = picker.countDownDuration;
方法
- 设置时间
- (void)setDate:(NSDate *)date animated:(BOOL)animated;
网友评论