UIAlertView常用属性(9.0起失效)
来源:互联网 发布:淘宝上传宝贝描述模版 编辑:程序博客网 时间:2024/06/16 19:37
UIAlertView的继承关系:
UIAlertView:UIView:UIResponder:NSObject
- (void)viewDidLoad{ [super viewDidLoad]; /** 1、初始化 - initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles: */ UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示框" message:@"这是我测试的一个提示框" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; /** 2、设置属性 .alertViewStyle //设置类型 UIAlertViewStyleDefault默认、 SecureTextInput密码输入框、 PlainTextInput普通输入框、 LoginAndPasswordInput账号密码框 .title //设置标题 .message //设置消息 .visible //获取是否显示,判断控件是否显示 (只读属性) */ alertView.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput; NSLog(@"title:%@", alertView.title); NSLog(@"message:%@",alertView.message); NSLog(@"visible:%d",alertView.visible); /** 3、配置按钮 - addButtonWithTitle: //添加新的按钮 - buttonTitleAtIndex: //根据索引,获取按钮的标题 - textFieldAtIndex: //根据索引,获取文本输入框的内容 .numberOfButtons //总的按钮数 .cancelButtonIndex //取消按钮的index .firstOtherButtonIndex //第一个其他按钮的index */ [alertView addButtonWithTitle:@"完成"]; NSLog(@"buttonTitleAtIndex:%@", [alertView buttonTitleAtIndex:1]); NSLog(@"numberOfButtons:%d", alertView.numberOfButtons); NSLog(@"cancelButtonIndex:%d", alertView.cancelButtonIndex); NSLog(@"firstOtherButtonIndex:%d", alertView.firstOtherButtonIndex); /** 4、显示 - show */ [alertView show]; /** 5、回收AlertView - dismissWithClickedButtonIndex:animated: */ /** 6、代理 .delegate - alertView:clickedButtonAtIndex: //点击按钮时触发的方法 - alertViewShouldEnableFirstOtherButton: //设置是否允许第一个按钮不是取消按钮 - willPresentAlertView: //将要展现警告框时触发的方法 - didPresentAlertView: //已经展现警告框时触发的方法 - alertView:willDismissWithButtonIndex: //警告框将要消失时触发的方法 - alertView:didDismissWithButtonIndex: //警告框已经消失时触发的方法 - alertViewCancel: //alertView消失前要执行的行为。 */}
0 0
- UIAlertView常用属性(9.0起失效)
- UIActionSheet常用属性(控件8.3之后失效)
- 改变UIAlertView中的属性
- 4.ScrollView常用属性,常用代理方法,图片轮播器,UIAlertView/UIActionSheet
- iPhone UIAlertView属性及使用方法
- iPhone常用控件、UIActionSheet、UIAlertView
- iPhone常用控件、UIActionSheet、UIAlertView
- 苹果开发 笔记(85)UIActionSheet 和UIAlertView 已经失效
- iPhone开发UIAlertView属性及使用方法
- iOS scrollsToTop属性失效
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- NETのWIN7+IIS 7.5下URLRewriter组件伪静态设置
- webuploader解决不能重复上传问题
- 设计模式-单利
- shell文本过滤编程(七):awk之变量传递
- java File类mkdir()与mkdirs()方法的区别:
- UIAlertView常用属性(9.0起失效)
- 数据展现---BIRT报表
- iOS崩溃调试的使用和技巧总结
- centos7将pub文件加入authorized_keys以后还是要输入密码,解决方法
- java有几种对象(PO,VO,DAO,DTO,BO,POJO详解)
- 求集合的交集
- Java零基础入门系列08--异常[参考正文顶部目录]
- Microsoft Outlook 漏洞:可允许远程代码执行
- shell文本过滤编程(九):sed命令