自定义时间选择器RZDatePickerView

RZDatePickerView

自定义DatePickerView
https://github.com/rzrobert/RZDatePickerView

example
example

默认样式:

默认样式.png

使用方法

- (void)showDatePickerWithType:(RZDateStyle)type {
    RZDatePickerView *datepicker = [[RZDatePickerView alloc] initWithCurrentDate:[NSDate date:@"2017-3-15 11:11" WithFormat:@"yyyy-MM-dd HH:mm"] CompleteBlock:^(NSDate *startDate) {
        self.timeLabel.text = [startDate stringWithFormat:@"yyyy-MM-dd HH:mm"];
    }];
    
    // datepicker.datePickerStyle = type;
    
    datepicker.datePickerStyle = DateStyleShowYearMonthDayHourMinute;
    //    datepicker.datePickerStyle = DateStyleShowMonthDayHourMinute;
    //    datepicker.datePickerStyle = DateStyleShowYearMonthDay;
    //    datepicker.datePickerStyle = DateStyleShowMonthDay;
    //    datepicker.datePickerStyle = DateStyleShowHourMinute;
    datepicker.minLimitDate = [NSDate date:@"1997-2-28 12:22" WithFormat:@"yyyy-MM-dd HH:mm"];
    datepicker.maxLimitDate = [NSDate date:@"2022-12-28 22:12" WithFormat:@"yyyy-MM-dd HH:mm"];
    // 默认值——选择时间
    datepicker.title =  @"选择时间";
    [datepicker show];

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 174,138评论 25 709
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,174评论 19 139
  • 失去灵魂的女性 这也是我今天越来越少看小说的原因。 在一集extra credits游戏设计视频里面,我记得这么一...
    质子陈阅读 272评论 0 1
  • 记得洋光老师说过要做一个会爱别人的人,她当年成立了西安分校,今年离开西安分校就说自己原来不是一个懂得爱的人,爱不该...
    DayWang阅读 255评论 0 1
  • 气象数据一贯以复杂繁多而著称,甚至大数据技术的迅猛发展也与气象、航天等拥有庞大数据领域的迫切需求不无关系。 ...
    易萧萧阅读 1,243评论 0 3