使用UIActionSheet 弹出UIDatePicker
来源:互联网 发布:淘宝网男士长袖衬衣 编辑:程序博客网 时间:2024/05/18 02:32
-(IBAction)SelectValue:(id)sender
{
NSString *title = UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"\n\n\n\n\n\n\n\n\n" : @"\n\n\n\n\n\n\n\n\n\n\n\n" ;
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:title delegate:self cancelButtonTitle:@"确定" destructiveButtonTitle:nil otherButtonTitles:nil];
[actionSheet showInView:self.view];
UIDatePicker *datePicker = [[[UIDatePicker alloc] init] autorelease];
datePicker.tag = 101;
datePicker.datePickerMode = 1;
[actionSheet addSubview:datePicker];
[actionSheet showFromTabBar:(UITabBar *)self.tabBarController.view];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
UIDatePicker *datePicker = (UIDatePicker *)[actionSheet viewWithTag:101];
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
formatter.dateFormat = @"yyyy年 MM月 dd日";
NSString *timesp = [formatter stringFromDate:datePicker.date];
TradedateLabel.text =timesp;
[actionSheet release];
}
{
NSString *title = UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"\n\n\n\n\n\n\n\n\n" : @"\n\n\n\n\n\n\n\n\n\n\n\n" ;
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:title delegate:self cancelButtonTitle:@"确定" destructiveButtonTitle:nil otherButtonTitles:nil];
[actionSheet showInView:self.view];
UIDatePicker *datePicker = [[[UIDatePicker alloc] init] autorelease];
datePicker.tag = 101;
datePicker.datePickerMode = 1;
[actionSheet addSubview:datePicker];
[actionSheet showFromTabBar:(UITabBar *)self.tabBarController.view];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
UIDatePicker *datePicker = (UIDatePicker *)[actionSheet viewWithTag:101];
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
formatter.dateFormat = @"yyyy年 MM月 dd日";
NSString *timesp = [formatter stringFromDate:datePicker.date];
TradedateLabel.text =timesp;
[actionSheet release];
}
- 使用UIActionSheet 弹出UIDatePicker
- UIActionSheet 弹出UIDatePicker
- 2.1 UIAlertView,UIActionSheet,UIDatePicker,UIPickerView使用的简单总结
- UIDatePicker 添加到 UIActionSheet 上
- UIActionSheet和UIDatePicker以及UIPickerView
- MMPopupView(自定义UIAlertView、UIActionSheet、UIDatePicker)
- UIActionSheet 弹出时箭头
- UIActionSheet 使用
- 使用UIActionSheet
- UIActionSheet使用
- UIButton点击之后弹出UIDatePicker
- ios-王云鹤 把UIdatePicker 嵌入到 UIActionSheet中
- obj-c UIDatePicker使用
- UIDatePicker的使用
- UIDatePicker的使用
- UIDatePicker 的使用
- UIDatePicker控件简单使用
- UIDatePicker 使用详解
- 背景全屏,左右两边颜色不一样,DIV+CSS 布局
- 内存分配和管理
- gcc版本不同导致的编译错误?
- asp.net mvc +dwz
- OpenCv矩阵操作函数大全
- 使用UIActionSheet 弹出UIDatePicker
- LDD3笔记:第三章 字符设备驱动
- 随笔
- 两种获取connectionString的方式
- 在Android上运行python程序
- Linux内核调试技术指南
- 用opencv画两幅图片的直方图
- poj 2256 P U I 字符串
- 中断处理