IOS - UIActionSheet 弹出选择按钮项
2017-03-02 22:08
381 查看
加入代理
添加button的点击响应,响应事件中代码如下
delegate
参考:http://blog.csdn.net/totogo2010/article/details/7618891
@interface ImagePickeriewController ()<UIActionSheetDelegate> @end
添加button的点击响应,响应事件中代码如下
-(void) photoImageClicked{ UIActionSheet *photoSheet; photoSheet = [[UIActionSheet alloc] initWithTitle:@"选择" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"拍照", @"从相册选择", nil]; photoSheet.tag = 255; [photoSheet showInView:_photoView]; }
delegate
-(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ if(actionSheet.tag == 255){ if (buttonIndex == 0) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"拍照" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:NULL]; [alert show]; }else if (buttonIndex == 1){ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"从相册选择" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:NULL]; [alert show]; }else{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"取消" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:NULL]; [alert show]; } } }
参考:http://blog.csdn.net/totogo2010/article/details/7618891
相关文章推荐
- 2.UIActionSheet类(在iOS弹出的选择按钮项)
- Snail—UI学习之弹出按钮选择项UIActionSheet
- 【代码笔记】iOS-UIActionSheet动态添加按钮
- iOS中的表单按钮选项UIActionSheet常用方法整理
- IOS UIActionSheet(底部 弹出框的使用)
- UIActionSheet 选择按钮列表
- 【代码笔记】iOS-UIActionSheet动态添加按钮
- iOS中UIActionSheet动态添加按钮
- iOS开发之自定义系统的UIActionSheet修改按钮的属性
- iOS 设置UIActionSheet 按钮颜色
- Iphone SDK ActionSheet 在当前窗口弹出时间选择
- UIActionSheet操作表单-IOS开发
- ios & UIActionSheet
- C#+Emgucv通过点击按钮弹出选择文件对话框
- iOS-UIActionSheet的简单使用和调用系统相簿
- IOS开发UI篇之──自定义UIActionSheet
- iOS开发基础 - UIActionSheet
- UIActionsheet 的取消按钮问题
- iPhone开发之动态添加UIActionSheet按钮
- UIActionSheet动态添加按钮