iOS之UIActionSheet
来源:互联网 发布:php授权码怎么做 编辑:程序博客网 时间:2024/05/16 19:00
1、.h
#import <UIKit/UIKit.h>@interface FKViewController : UIViewController <UIActionSheetDelegate>- (IBAction)clicked:(id)sender;@end
2、.m
#import "FKViewController.h"@interface FKViewController ()@end@implementation FKViewController- (void)viewDidLoad{[super viewDidLoad];}- (void)didReceiveMemoryWarning{[super didReceiveMemoryWarning];}- (IBAction)clicked:(id)sender {// 创建一个UIActionSheetUIActionSheet* sheet = [[UIActionSheet alloc]initWithTitle:@"请确认是否删除" // 指定标题delegate:self // 指定该UIActionSheet的委托对象就是该控制器自身cancelButtonTitle:@"取消" // 指定取消按钮的标题destructiveButtonTitle:@"确定" // 指定销毁按钮的标题otherButtonTitles:@"按钮一", @"按钮二", nil]; // 为其他按钮指定标题// 设置UIActionSheet的风格sheet.actionSheetStyle = UIActionSheetStyleAutomatic;[sheet showInView:self.view];}- (void)actionSheet:(UIActionSheet *)actionSheetclickedButtonAtIndex:(NSInteger)buttonIndex{// 使用UIAlertView来显示用户单击了第几个按钮UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"提示"message:[NSString stringWithFormat:@"您单击了第%d个按钮" , buttonIndex]delegate:nilcancelButtonTitle:@"确定"otherButtonTitles: nil];[alert show];}@end
0 0
- iOS 之UIActionSheet应用
- iOS之UIActionSheet
- IOS之UIActionSheet& UIAlertView
- IOS开发之自定义UIActionSheet
- iOS之UIActionSheet的使用
- IOS开发之自定义UIActionSheet
- iOS 之UIActionSheet+UIToolBar+UIDatePickerView
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- iOS学习之UIActionSheet的使用
- HTTP协议分析系列(七)------http协议之refer防盗链
- eclipse一些全局设置
- 关于手机屏幕,一直很困惑的东西
- 页面下载
- silverlight 中DataGrid分组,分组名中午显示,分组数据ID转为Name显示
- iOS之UIActionSheet
- foot 固定底部 不用绝对定位
- Android 中Touch(触屏)事件传递机制
- maven的安装配置
- 堆heap与栈stack区别
- Java双重循环实现任意字符串中提取数字子串
- 从字体文件中获取字体名字
- 大数阶乘——————数组模拟
- jquery.ready与window.onload执行顺序