UIAlertView提示控件和UIActionSheet的使用
来源:互联网 发布:搜索引擎优化实战培训 编辑:程序博客网 时间:2024/06/05 10:43
一 UIAlertView:
1、UIAlertView 是系统提供的提示UI控件,出现在屏幕的中间。使用时可通过代理来触发相应的方法
UIAlertView 代理方法UIAlertViewDelegate
2、初始化 alertView
<span style="font-size:18px;">// 初始化{UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示:"message:@"明天你好!"delegate:self cancelButtonTitle:@"取消按钮"otherButtonTitles:@"其他按钮",nil];// 让 显示 alertView[alertView show];}</span>
3、UIAlertView 的代理 UIAlertViewDelegate
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{//点击的是哪个按钮,通过buttonIndex 来判断。一个是取消按钮,一个是其他的按钮,buttonIndex 为0或者1}
二 UIActionSheet:
1、UIActionSheet 也是系统提供的提示UI控件,它从屏幕的底部弹出来,使用时可通过代理来触发相应的方法
UIActionSheet 代理方法UIActionSheetDelegate
2、初始化 UIActionSheet
<span style="font-size:18px;">// 初始化{UIActionSheet *sheet = [[UIActionSheet alloc]initWithTitle: @"更换图片" delegate:self cancelButtonTitle:@"取消"destructiveButtonTitle:@"本地图片"otherButtonTitles:@"其他图片",nil];// 挂上代理,并把它添加到self.view 上 sheet.delegate =self; [sheet showInView:self.view];}</span>
3、UIActionSheet 代理方法UIActionSheetDelegate
<span style="font-size:18px;">// 代理方法UIActionSheet 代理方法UIActionSheetDelegate- (void)actionSheet:(UIActionSheet*)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{点击的是哪个按钮,通过 buttonIndex 来判断。}</span>
0 0
- UIAlertView提示控件和UIActionSheet的使用
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet)
- IOS提示控件UIActionSheet,UIAlertView
- IOS提示控件UIActionSheet,UIAlertView
- UIAlertView,UIActionSheet的使用
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- 山峰
- 将矩阵顺时针旋转90度 leetCode:Rotate Image
- Convert Sorted List to Binary Search Tree
- Java中的进制转换,练习
- linux 几个简单shell脚本demo
- UIAlertView提示控件和UIActionSheet的使用
- CodeForces-327A Flipping Game
- ant 中 if else
- 你不知道的JavaScript--Item25 创建对象(类)的8种方法总结
- IOS9自定义UIWindow被键盘盖住(在键盘下面)解决方法
- javaWeb开发之基础--------------MySQL数据库总结
- uva548
- tyvj|P1089 smrtfun
- RGB转jpg使用libjpeg库实现