自封时间选择滚轮
来源:互联网 发布:js开发框架 编辑:程序博客网 时间:2024/04/28 03:06
- (void)pickViewCount_str:(void(^)(NSString * datestr))count_str{
UIAlertController* alertVc=[UIAlertController alertControllerWithTitle:@"\n\n\n\n\n\n\n\n\n\n\n" message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
UIDatePicker* datePicker=[[UIDatePicker alloc]init];
datePicker.datePickerMode = UIDatePickerModeDate;
[datePicker setMaximumDate:[NSDate date]];
NSLocale *locale = [[NSLocale alloc]initWithLocaleIdentifier:@"zh_CN"];
datePicker.locale = locale;
// 设置DatePicker的center
CGPoint center = datePicker.center;
center.x = alertVc.view.frame.size.width * 0.48;
datePicker.center = center;
UIAlertAction* ok=[UIAlertAction actionWithTitle:@"确认" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) {
NSDate* date=[datePicker date];
NSDateFormatter* formatter=[[NSDateFormatter alloc]init];
[formatter setDateFormat:@"yyyy-MM-dd"];
_timestring=[formatter stringFromDate:date];
count_str(_timestring);
}];
UIAlertAction* no=[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleDefault) handler:nil];
[alertVc.view addSubview:datePicker];
[alertVc addAction:ok];
[alertVc addAction:no];
[self presentViewController:alertVc animated:YES completion:nil];
}
//调用
[self pickViewCount_str:^(NSString *count_str) {
NSLog(@"===-=--=%@",count_str);
}];
UIAlertController* alertVc=[UIAlertController alertControllerWithTitle:@"\n\n\n\n\n\n\n\n\n\n\n" message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
UIDatePicker* datePicker=[[UIDatePicker alloc]init];
datePicker.datePickerMode = UIDatePickerModeDate;
[datePicker setMaximumDate:[NSDate date]];
NSLocale *locale = [[NSLocale alloc]initWithLocaleIdentifier:@"zh_CN"];
datePicker.locale = locale;
// 设置DatePicker的center
CGPoint center = datePicker.center;
center.x = alertVc.view.frame.size.width * 0.48;
datePicker.center = center;
UIAlertAction* ok=[UIAlertAction actionWithTitle:@"确认" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) {
NSDate* date=[datePicker date];
NSDateFormatter* formatter=[[NSDateFormatter alloc]init];
[formatter setDateFormat:@"yyyy-MM-dd"];
_timestring=[formatter stringFromDate:date];
count_str(_timestring);
}];
UIAlertAction* no=[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleDefault) handler:nil];
[alertVc.view addSubview:datePicker];
[alertVc addAction:ok];
[alertVc addAction:no];
[self presentViewController:alertVc animated:YES completion:nil];
}
//调用
[self pickViewCount_str:^(NSString *count_str) {
NSLog(@"===-=--=%@",count_str);
}];
0 0
- 自封时间选择滚轮
- 滚轮选择时间控件-选择数值-选择字符串
- 仿iOS滚轮时间选择器和地区选择
- Android滚轮时间选择控件(可扩展自定义)
- PickerView滚轮选择
- android:最简单的方式实现自定义选择时间分钟间隔,非滚轮方式
- 仿iOS滚轮选择控
- Android时间滚轮(一)
- Android时间滚轮(二)
- 安卓学习笔记---Android-PickerView实现 3D滚轮效果(时间选择器、省市区三级联动,单项选择效果)
- android 仿IOS的滚轮选择控件
- 用NumberPicker实现二联动滚轮选择
- Android省市区三级联动滚轮选择
- 仿ios的滚轮选择控件
- Android 高仿 IOS 滚轮选择控件
- Android 高仿 IOS 滚轮选择控件
- Andoird仿IOS滚轮选择控件
- UIDatePicker 日期/时间选取器(滚轮)
- linux环境定义命令快捷键
- 不要尝试apt-get autoremove wine,后果很严重
- openwrt命令行模式命令及其工具
- spark-java-task未序列化
- 17monipdb.dat文件结构
- 自封时间选择滚轮
- Akka 快速入门
- Struts2 类型转换错误相关。
- Java中JNI的使用详解第二篇:JNIEnv类型和jobject类型的解释
- Swing窗口可视化
- spring的事务不起作用的解决办法亲测
- setClickable,setEnabled,setFocusable 的区别
- .net Ajax跨域
- 让弹性盒模型失效