UIday0803:UIDatePicker的属性和用法
来源:互联网 发布:linux卸载光盘 编辑:程序博客网 时间:2024/06/05 12:50
RootViewController.m
#import "RootViewController.h"@interface RootViewController ()@property(nonatomic,strong)RootView * rv;@end@implementation RootViewController-(void)loadView{ self.rv = [[RootView alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.view = _rv;}- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //样式 self.rv.datePicker.datePickerMode = UIDatePickerModeDate;// self.rv.datePicker.datePickerMode = UIDatePickerModeCountDownTimer; //国际化 显示中文日期 中文zh_CN 英文en_US self.rv.datePicker.locale = [NSLocale localeWithLocaleIdentifier:@"zh_CN"]; //日历 self.rv.datePicker.calendar = [NSCalendar currentCalendar]; //时区 self.rv.datePicker.timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"]; //时间格式 NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init]; [dateFormatter setDateFormat:@"yyyy"]; //最小时间 self.rv.datePicker.minimumDate = [dateFormatter dateFromString:@"2000"]; //最大时间 self.rv.datePicker.maximumDate = [dateFormatter dateFromString:@"2015"]; //当前表盘停留在哪个时间上// self.rv.datePicker.countDownDuration = 60*60;// // //时间刻度// self.rv.datePicker.minuteInterval = 3; // NSLog(@"%@",[NSTimeZone,]) }static int count = 0;-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ // 用触发的方式改变表盘上的值// self.rv.datePicker.countDownDuration = count++ * 60; // 获取表盘上的时间 NSLog(@"%@",self.rv.datePicker.date); }- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}@end
RootView.m
#import "RootView.h"@implementation RootView- (instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { [self p_setupViews]; } return self;}-(void)p_setupViews{ self.backgroundColor = [UIColor yellowColor]; self.datePicker = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, 100, 200)]; // 属性 // 样式// self.datePicker.datePickerMode = UIDatePickerModeTime;// // self.datePicker.datePickerMode = UIDatePickerModeDate;// // self.datePicker.datePickerMode = UIDatePickerModeDateAndTime; // self.datePicker.datePickerMode = UIDatePickerModeCountDownTimer; // NSLog(@"%@",self.datePicker.locale); // NSLog(@"%@",self.datePicker.date); [self addSubview:_datePicker]; }
0 0
- UIday0803:UIDatePicker的属性和用法
- UIDatePicker的简单用法
- UIDatePicker的用法
- 简述UIDatePicker的用法
- UIDatePicker的用法
- 简述UIDatePicker的用法
- UIDatePicker的简单用法
- iOS UIDatePicker 的 用法
- UIPickerView和UIDatePicker常用属性
- UIDatePicker的用法:最小日期和最大日期
- 简述UIDatePicker的用法(转载)
- iOS9中UIDatePicker的用法
- UIPickerView和UIDatePicker的常见属性和方法,以及其代理方法和数据源方法(0806)
- ios开发中UIDatePicker 的一些用法
- iOS——UIDatePicker的用法
- UIDatePicker常用属性
- UIPickerView和UIDatePicker的常用方法
- iOS UIPickView和UIDatePicker的基本使用
- Keep-Alive
- zoj 3494 BCD Code (ac自动机+数位dp)
- swift cell的高度是动态的 三个文件:控制器 cell Frame类
- 浏览,确认提交里获取文件名、文件路径、上传图片
- DP 最长公共子序列并标记输出
- UIday0803:UIDatePicker的属性和用法
- 学习zsh
- 黑马程序员----c基础笔记----指针
- 人工智能学习(链接)
- Ngin的配置文件nginx.conf完整配置说明(包括fastcgi和负载均衡设置)
- 核主成分分析KPCA+C代码
- 深入java--JRE与JDK的区别
- 假设检验初步
- 弗洛伊德