zoukankan      html  css  js  c++  java
  • UIDatePicker

    //创建UIDatePicker (高度不能修改)
        UIDatePicker *datePicker =[[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, 200, 800)];
        //设置默认显示时间
        datePicker.date =[NSDate dateWithTimeInterval:-24*60*60 sinceDate:[NSDate date]];
        //设置最小日期
        datePicker.minimumDate =[NSDate dateWithTimeInterval: -24*60*60*3 sinceDate:[NSDate date]];
        //设置最大日期
        datePicker.maximumDate =[NSDate dateWithTimeInterval:24*60*60*3 sinceDate:[NSDate date]];
        //    UIDatePicker 基于UIControl
        [datePicker addTarget:self action:@selector(dateAct:) forControlEvents:UIControlEventValueChanged];
        //日期
        datePicker.datePickerMode =UIDatePickerModeDate;
        //倒计时
        datePicker.datePickerMode =UIDatePickerModeCountDownTimer;
        //时间
        datePicker.datePickerMode =UIDatePickerModeTime;
        //默认时间和日期
        datePicker.datePickerMode =UIDatePickerModeDateAndTime;
        [self.view addSubview:datePicker];
    }
    //valueChanged时 会调用该方法
    - (void)dateAct:(UIDatePicker *)picker{
        NSLog(@"%@",picker.date);

    }

  • 相关阅读:
    微信授权页面执行ajax不执行,刷新才能执行
    spring boot使用jpa的@Modify的clearAutomatically=true的作用
    Excel转HTML
    reporting reportservice(SSRS) 让某行变成自增序号
    Excel的操作插件
    https-加解密
    防篡改防重
    加密解密
    git 常用命令

  • 原文地址:https://www.cnblogs.com/yxt9322yxt/p/4748092.html
Copyright © 2011-2022 走看看