action sheet
来源:互联网 发布:spss数据分析游戏 编辑:程序博客网 时间:2024/06/05 08:38
#pragma mark - show UIActionSheetDelegate-(IBAction)shows:(id)sender{ UIActionSheet *alert = [[UIActionSheet alloc]initWithTitle:@"title" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"这是哪个button" otherButtonTitles:@"other1",@"other2", nil]; [alert showInView:self.view];}#pragma mark - UIActionSheetDelegate- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ //获得当前索引按钮的标题 NSString *title = [actionSheet buttonTitleAtIndex:buttonIndex]; NSLog(@"%@",title);}
ios8.0 之后,用这个替换
#pragma mark - show-(IBAction)shows:(id)sender{// UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"My Title" message:@"show to you" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",@"Other", nil];// [alert show]; UIAlertController* alert = [UIAlertController alertControllerWithTitle:nil //nil 这一项就会隐藏 message:@"This is an alert." //nil 这一项就会隐藏 preferredStyle:UIAlertControllerStyleAlert];// typedef enum UIAlertControllerStyle: NSInteger {// UIAlertControllerStyleActionSheet = 0, //底端出现的 就是 UiActionSheet// UIAlertControllerStyleAlert //对话框// } UIAlertControllerStyle; UIAlertAction* OKAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { NSLog(@"%@",action.title); }]; UIAlertAction* CancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { NSLog(@"%@",action.title); }]; //addAction 添加 [alert addAction:OKAction]; [alert addAction:CancelAction]; [self presentViewController:alert animated:YES completion:nil];}
0 0
- action sheet
- action sheet
- Delegate,Action Sheet, Alert
- Ionic2 Action Sheet详解
- Message Box (Action Sheet) General
- action sheet 也来 block ~
- Presenting action sheet clipped by its superview
- ionic添加cordova插件-Action Sheet
- action-sheet和showActionSheet的区别
- iphone dev--如何让uiAlertView、action sheet用代码消失
- textview,slider,switch,segmented ,action sheet,alert,indicator
- iOS SDK:创建一个动态的Action Sheet
- iOS SDK:创建一个动态的Action Sheet
- jQueryMobile的(十八) 快捷标签插件 Action Sheet
- iOS7应用开发16:模态segue、文本框、警告、Action Sheet
- Presenting action sheet clipped by its superview UIActionSheet和UITabBarViewController
- 《iOS Human Interface Guidelines》——Action Sheet
- 微信小程序把玩(二十二)action-sheet组件
- LeetCode 13:Roman to Integer
- Android Sqlite之删除超过50条的数据
- 【web前端攻城狮】表单操作之更换表单顺序容易忽略的地方
- svn的恢复到指定版本操作
- poj 1063 Flip and Shift 冒泡排序的扩展运用
- action sheet
- mysql rpm安装5.6
- onSaveInstanceState和onRestoreInstanceState触发的时机
- 10021---JavaScript--HTML DOM (文档对象模型)简介
- 屏幕和尺寸单位
- ARM PROCESSOR FUNDAMENTALS(arm处理器基础)
- jquery如何根据多选框name来获得选中的值
- xcode插件安装及卸载
- 展讯android 5.1系统部分功能修改学习总结