UI UIActionSheet
来源:互联网 发布:文化部网络直播黑名单 编辑:程序博客网 时间:2024/05/16 17:47
<span style="font-size:18px;"> UIActionSheet *actionSheet=[[UIActionSheet alloc]initWithTitle:@"标题" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"destructiveButtonTitle" otherButtonTitles:@"otherButton", nil]; //添加Button //[actionSheet addButtonWithTitle:@"确定"]; //获取对应下标button的标题 NSLog(@"0:%@ 1:%@ 2:%@",[actionSheet buttonTitleAtIndex:0],[actionSheet buttonTitleAtIndex:1],[actionSheet buttonTitleAtIndex:2]); [self.window addSubview:actionSheet]; [actionSheet release]; self.actionSheet=actionSheet; UIButton *button=[UIButton buttonWithType:UIButtonTypeSystem]; button.frame=CGRectMake(50, 50, 100, 50); [button setTitle:@"按钮" forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; [self.window addSubview:button]; - (void)buttonAction:(UIButton*)button{ [self.actionSheet showInView:self.window];}- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ if (buttonIndex==1) { NSLog(@"otherButton"); } if (buttonIndex==2) { NSLog(@"取消"); } if (buttonIndex==0) { NSLog(@"destructiveButtonTitle"); }}</span>
0 0
- UI UIActionSheet
- UI基础:UIActionSheet和UIAlterView
- UIActionSheet,UIAlertView等UI控件用法
- 10-常用UI控件之 UIActionSheet
- 【UI进阶】UIAlertController替代UIAlertView和UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- UIActionSheet
- android开发步步为营之54:读取assets,raw文件夹下文件
- php安全
- 【HDU 1042】N! —— 高精度整数
- svn的建立以及使用
- thinkphp3.1.3多对多关联模型BUG修复
- UI UIActionSheet
- 机房重构之数据库设计
- 在ubuntu下如何搜索文件?
- 求int型数据在内存中存储时1的个数 (十进制转二进制)
- win7下搭建hadoop2.6.0伪分布式平台
- 浅谈void 和void*
- 浅谈php安全
- 面向对象(匿名对象的使用)
- VB.NET 章鱼哥 自定义控件的建立和使用