OneDayOneClass----UIActionSheet
2015-04-23 10:11
239 查看
// Created By 郭仔 2015年04月23日10:07:44
// -========================
有一段时间没更新这个系列了!
// ==========================
首先通过button事件触发UIActionSheet:
实现协议中方法:
=============
哦了~
// -========================
有一段时间没更新这个系列了!
// ==========================
首先通过button事件触发UIActionSheet:
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:@"标题" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"确定" otherButtonTitles:@"第一项",@"第二项", nil]; actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque; // 添加title [actionSheet addButtonWithTitle:@"添加的"]; actionSheet.backgroundColor = [UIColor orangeColor]; //actionSheet.tintColor = [UIColor redColor]; NSLog(@"%@",[actionSheet buttonTitleAtIndex:0]); [actionSheet showInView:self.window]; [actionSheet release];然后封装showAlert方法,点击时,触发该方法:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Action Sheet选择项" message:msg delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil]; [alert show];设置UIActionSheet的代理(协议:UIActionSheetDelegate)
实现协议中方法:
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 0) { [self showAlert:@"确定"]; }else if (buttonIndex == 1) { [self showAlert:@"第一项"]; }else if(buttonIndex == 2) { [self showAlert:@"第二项"]; }else if(buttonIndex == 3) { [self showAlert:@"取消"]; } }
=============
哦了~
相关文章推荐
- OneDayOneClass----UIAlertView
- OneDayOneClass----UISwitch
- OneDayOneClass----UIStepper
- day 019 UITextField UIAlertView UIActionSheet
- [源码下载]UIActionSheet详解
- 【转载】#324 - A Generic Class Can Have More than One Type Parameter
- iOS学习之UIActionSheet的使用
- ios里的UIActionSheet的使用
- 【one day one linux】find 用法详解小记
- UIActionSheet的使用
- IOS学习——UIActionSheet的使用
- IOS UIAlertView UIActionSheet
- http://www.cnblogs.com/oneday/archive/2012/08/16/2643039.html
- UI控件篇——UIActionSheet(操作表)和UIAlertView(警告框)
- one class SVM
- UIActionSheet实例,显示简单菜单
- iOS 弹窗UIAlertView、UIActionSheet、UIAlertController简述 —— HERO博客
- 基于One-Class的矩阵分解方法
- #“Machine Learning”(Andrew Ng)#Week 3_3:Multiclass Classification One-vs-all
- Algorithm One Day One -- 判断链表是否有环(下)