UIActionSheet and UIAlertView
来源:互联网 发布:淘宝导航代码大全 编辑:程序博客网 时间:2024/05/22 10:57
- (IBAction)buttonPressed:(id)sender { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure?" delegate:self cancelButtonTitle:@"No Way!" destructiveButtonTitle:@"Yes, I’m Sure!" otherButtonTitles:nil]; [actionSheet showInView:self.view];}Next, add a new method just after the existing buttonPressed: method:- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ if (buttonIndex != [actionSheet cancelButtonIndex]) { NSString *msg = nil; if ([self.nameField.text length] > 0) { msg = [NSString stringWithFormat: @"You can breathe easy, %@, everything went OK.", self.nameField.text];} else { msg = @"You can breathe easy, everything went OK.";}UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Something was done" message:msg delegate:self cancelButtonTitle:@"Phew!" otherButtonTitles:nil]; [alert show];}}
// 需要签订协议 <UIActionSheetDelegate>
0 0
- UIActionSheet and UIAlertView
- UIActionSheet and UIAlertView
- UIAlertController replaces the UIActionSheet and UIAlertView
- UIAlertController VS UIAlertView and UIActionSheet
- UIAlertview UIActionSheet
- UIAlertView&UIActionSheet
- UIAlertView、UIActionSheet
- UIAlertView、UIActionSheet
- UIAlertView,UIActionSheet, UIMenuController
- UIAlertView vs UIActionSheet
- UIActionSheet与UIAlertView
- UIActionSheet与UIAlertView
- UIActionSheet与UIAlertView
- UIAlertView、UIActionSheet兼容iOS8
- UIActionSheet与UIAlertView
- IOS-UIAlertView和UIActionSheet
- UIActionSheet和UIAlertView
- UIAlertView和UIActionSheet
- 【HDU】5383 Yu-Gi-Oh!【费用流】
- C语言中,头文件的作用,头文件和源文件的关系(转)
- 黑马程序员——Java基础--GUI(图形化界面)
- JAVA wait(), notify(),sleep详解
- android Graphics(一):概述及基本几何图形绘制
- UIActionSheet and UIAlertView
- UI0810通讯录加强版
- vim 配置vim
- STM32学习笔记——中断
- ZOJ 3080 ChiBi [图论]
- 路由交换基本命令+一些笔记
- (转)Android中用OpenGL ES Tracer分析绘制过程
- OpenGL ES 光照
- HDU 5372 - Segment Game(树状数组)