UIActionSheet and UIAlertView
来源:互联网 发布:4g网络1g流量能用多久 编辑:程序博客网 时间:2024/06/06 07:24
- (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
- 认知http
- How to check which certificate was used to sign my app
- POJ 2312 Battle City
- 【Android基础】Android中的Intent详解
- ORACLE分页查询SQL语法
- UIActionSheet and UIAlertView
- [leetcode] Longest Common Prefix 字符窜最长公共前缀判断
- AC自动机算法详解
- Linq的join后面跟多个条件
- (转)Android软件测试的日志文件抓取简介
- 位运算
- Asp.Net的简介
- Hibernate 基本配置和应用
- Linux socket编程的心跳机制总结