Iphone SDK ActionSheet 在当前窗口弹出时间选择
来源:互联网 发布:java等级考试报名时间 编辑:程序博客网 时间:2024/05/15 23:51
1.首先实现UIActionSheetDelete协议
2.
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:nil destructiveButtonTitle:nil otherButtonTitles:@"Set", nil];
[actionSheet showInView:self.view];
UIDatePicker *datePicker = [[[UIDatePicker alloc] init] autorelease];
datePicker.tag = 101;
// datePicker.datePickerMode = [(UISegmentedControl *)self.navigationItem.titleView selectedSegmentIndex];
[actionSheet addSubview:datePicker];
3.响应点击 Set后的函数
//根据 buttonIndex的参数的不同,进行处理。
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
UIDatePicker *datePicker = (UIDatePicker *)[actionSheet viewWithTag:101];
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
formatter.dateFormat = @"MM/dd/YY h:mm a";
NSString *timestamp = [formatter stringFromDate:datePicker.date];
//显示时间的变量
[(UILabel *)[self.view viewWithTag:103] setText:timestamp];
[actionSheet release];
}
- Iphone SDK ActionSheet 在当前窗口弹出时间选择
- js 在弹出窗口里选择,回传值到原窗口
- Android仿IOS底部弹出选择菜单ActionSheet
- 弹出窗口,选择本地文件。
- iphone获取当前时间
- ActionSheet 显示在 UIWindow,弹出又消失了解决办法
- IPhone之自定义弹出窗口
- IPhone之自定义弹出窗口
- IPhone之自定义弹出窗口
- iphone之ActionSheet介绍
- 弹出日历窗口选择日期
- \cite{}不能弹出窗口选择
- 实现弹出窗口选择内容
- [IOS]iphone之在视图上显示当前的时间,并且时间还在走。
- [IOS]iphone之在视图上显示当前的时间,并且时间还在走。
- iphone获得当前系统时间
- IE9下uploadify在模态窗口里无法弹出选择文件窗口的问题
- iOS开发——ActionSheet的使用与弹出选择对话框
- 『Bash Script』拷贝文件cp只输入一次文件名
- UIScrollView 原理详解
- How to instantiate I2C devices[Doc-from-kernel]
- 『Bash Script』简单Web共享
- ico resources
- Iphone SDK ActionSheet 在当前窗口弹出时间选择
- Java数组的的一些知识
- 自己写的一个vc操作word的例子
- 分享我的书架:一个五年程序员的学习观
- DOS下的端口筛选
- 3DES+Base64 加密解密的方法
- DOS下的端口筛选
- Ubuntu 建立VPN链接
- Log4j的中文文档