UIKit框架-高级视图-UIDatePicker-时间选择器

UIDatePicker 时间选择器

属性
  • 创建
    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;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值