UIAlertView使用

UIAlertViewDelegate定义的常用方法

 1 // Called when a button is clicked. The view will be automatically dismissed after this call returns
 2 //当用户单击警告框中得某个按钮时激发该方法,buttonIndex代表用户单击的按钮的索引,从0开始
 3 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;
 4
 5 // Called when we cancel a view (eg. the user clicks the Home button). This is not called when the user clicks the cancel button.
 6 // If not defined in the delegate, we simulate a click in the cancel button
 7 //取消按钮时(用户单击home键)激发
 8 - (void)alertViewCancel:(UIAlertView *)alertView;
 9
10 // before animation and showing view
11 //警告框将要显示出来时激发
12 - (void)willPresentAlertView:(UIAlertView *)alertView;
13
14  // after animation
15 //警告框完全显示出来后激发
16 - (void)didPresentAlertView:(UIAlertView *)alertView;
17
18 // before animation and hiding view
19 //当用户通过单击某个按钮将要隐藏该警告框时激发
20 - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex;
21
22 // after animation
23 //当用户通过单击某个按钮完全隐藏该警告框时激发
24 - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;
25
26 // Called after edits in any of the default fields added by the style
27 //每次编辑输入框时会调用
28 - (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView;

UIAlertView的actionSheetStyle属性

1    UIAlertViewStyleDefault = 0,//默认的警告框风格
2     UIAlertViewStyleSecureTextInput,//警告框中包含一个密码输入框
3     UIAlertViewStylePlainTextInput,//警告框中包含一个普通输入框
4     UIAlertViewStyleLoginAndPasswordInput//警告框中包含用户名、密码两个输入框

访问警告框中textField 索引从0开始,自IOS5.0以后有的方法

- (UITextField *)textFieldAtIndex:(NSInteger)textFieldIndex NS_AVAILABLE_IOS(5_0);

时间: 2024-08-11 05:31:34

UIAlertView使用的相关文章

UIAlertView, UIAlertViewController

iOS 8的新特性之一就是让接口更有适应性.更灵活,因此许多视图控制器的实现方式发生了巨大的变化.全新的UIPresentationController 在实现视图控制器间的过渡动画效果和自适应设备尺寸变化效果(比如说旋转)中发挥了重要的作用,它有效地节省了程序员们的工作量(天地良心啊).还有,某 些旧的UIKit控件也同样发生了许多变化,比如说Alert Views.Action Sheets.Popovers以及Search Bar Controllers.本文将会对Alert Views和

IOS开发之UIAlertView与UIAlertController的详尽用法说明

本文将从四个方面对IOS开发中UIAlertView与UIAlertController的用法进行讲解: 一.UIAlertView与UIAlertController是什么东东? 二.我们为什么要用UIAlertView或UIAlertController? 三.如何使用UIAlertView和UIAlertController? 四.阅读提醒. 一.UIAlertView与UIAlertController是什么东东? 一句话,在所有移动应用中,出现的提示窗一般都由UIAlertView或U

UIAlertView弹出框

<Alert弹出框提示用户信息>    1.遵循代理方法<UIAlertViewDelete>    2.调用方法UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"恭喜通关!" message:@"更多精彩,请购买下一关~~" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"购买&

iOS8以后UIAlertView和UIActionSheet两种alert页面都将通过UIAlertController来创建

1. Important: UIAlertView is deprecated in iOS 8. (Note that UIAlertViewDelegate is also deprecated.) To create and manage alerts in iOS 8 and later, instead use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert. //UIAlertView和UI

iOS:提示框(警告框)控件UIAlertView的详解

提示框(警告框)控件:UIAlertView 功能:当点击按钮或标签等时,弹出一个提示框,显示必要的提示,然后通过添加的按钮完成需要的功能. 类型:typedef NS_ENUM(NSInteger, UIAlertViewStyle) { UIAlertViewStyleDefault = 0,                 //默认类型 UIAlertViewStyleSecureTextInput,          //安全密码的文本框输入类型 UIAlertViewStylePlai

UIAlertView

UIAlertView 1.Title 获取或设置UIAlertView上的标题. 2.Message 获取或设置UIAlertView上的消息 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确

iOS UIAlertView

iOS 开发中经常会遇到需要弹窗提示的情况(这个再浏览器端我们经常会遇到) 如下图: 这个是怎么实现的了? 其实很简单iOS提供一个类  UIAlertView 我们使用他即可 UIAlertView *alertV=[[UIAlertView alloc]initWithTitle:@"alert标题" message:@"alertMesaage" delegate:self cancelButtonTitle:@"取消" otherButt

UIAlertView - 弹出框

UIAlertView 继承于UIView 初始化方法:- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id /* <UIAlertViewDelegate>*/)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles,...,nil;  

UITableView与UIAlertView的 Delegate方法实现

一 UITableView Delegate 方必须遵循 UITableViewDelegate协议 cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 这句是定义cell右边的尖角号 #pragma mark - 代理方法 #pragma mark 返回indexPath这行cell的高度 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtInd

UIAlertView的使用方法

UIAlertView的使用方法 1. 最简单的用法 UIAlertView*alert = [[UIAlertView alloc]initWithTitle:@"提示" message:@"这是一个简单的警告框!" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [alert show]; [alert release]; 2. 为UIAlertView添加多个按钮 U