UIAlertView 基础篇
来源:互联网 发布:网络运维绩效考核 编辑:程序博客网 时间:2024/06/04 20:13
属性
title:标题
message:内容
numberOfButtons:获取按钮个数
cancelButtonIndex:设置将某一个按钮设置为取消按钮
firstOtherButtonIndex:返回其他类型按钮第一个的索引值
visible:警告框是否可见
alertViewStyle:警告框模式 (UIAlertViewStyleDefault,UIAlertViewStyleSecureTextInput,UIAlertViewStylePlainTextInput,UIAlertViewStyleLoginAndPasswordInput)
方法:
- (instancetype)initWithTitle:(nullable NSString *)title message:(nullable NSString *)message delegate:(nullable id /*<UIAlertViewDelegate>*/)delegate cancelButtonTitle:(nullable NSString *)cancelButtonTitle otherButtonTitles:(nullable NSString *)otherButtonTitles;初始化方法,可以设置标题,内容,住按钮,和其他按钮
- (id)initWithFrame:(CGRect)frame;设置位置大小
- (NSInteger)addButtonWithTitle:(nullable NSString *)title;添加一个按钮并返回该按钮的索引
- (nullable NSString *)buttonTitleAtIndex:(NSInteger)buttonIndex;根据按钮索引返回标题
- (void)show;展示警告框
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;模拟点击按钮消失触发的方法
- (nullable UITextField *)textFieldAtIndex:(NSInteger)textFieldIndex;设置文本框输入的索引
代理方法
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;点击按钮时触发的方法
- (void)alertViewCancel:(UIAlertView *)alertView;点击home键调用的方法
- (void)willPresentAlertView:(UIAlertView *)alertView;将要展现警告框时触发的方法
- (void)didPresentAlertView:(UIAlertView *)alertView ;警告框已经展示触发的方法
- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex;警告框将要消失触发的方法
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;警告框已经消失触发的方法
- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView;设置是否允许第一个按钮不是取消按钮
- UIAlertView 基础篇
- iOS基础 -- UIAlertView
- IOS:UIAlertView基础
- iOS基础控件---UIAlertView
- IOS开发基础篇之UIAlertView的使用
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIalertView
- java中volatile关键字的含义
- error C2039: “sort”: 不是“std”的成员
- Maven 常用命令收集
- 当打开Delphi7,出现“borland license information was found,but it is not valid for delphi”的错误,无法运行的解决方法
- 创建兼容 IE/FireFox 的 event 及 event 的 srcElement、fromElement、toElement 属性
- UIAlertView 基础篇
- 数据库设计
- Radio开发新功能
- cas系列(二)--cas单点登录配置
- 如何使用OpenCV实现基于标记的定位(为什么对标记检测能够实现定位)
- ORA-01789: query block has incorrect number of result columns
- 重写QWidget关闭时触发的事件
- Android 自定义 按当前view的宽高进行矩形移动内容图
- UVALA 4329 - Ping pong 树状数组+组合原理