UIAlertController 用法简介
来源:互联网 发布:易语言2017qq盗号源码 编辑:程序博客网 时间:2024/05/05 15:01
//让数组中所有元素 执行 相同的方法 removeFromSuperview
[_answerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
//是否允许用户进行交互
//一旦 父 view 被禁用,那么他的子view也将不会接收用户交互
_optionView.userInteractionEnabled = NO;
//把 iconButton (它是self.view 的子view)放到 view的最前面
[self.view bringSubviewToFront:_iconButton];
UIAlertController
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"come on!"message:@"you win!"preferredStyle:UIAlertControllerStyleAlert];
//样式:
UIAlertControllerStyleAlert : 提示框
UIAlertControllerStyleActionSheet : 从下面弹出的提示框
//想要显示alertController 必须通过下面的方法:
[selfpresentViewController:alertController animated:YEScompletion:nil];
//为alertController 添加 按钮
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"cancel"style:UIAlertActionStyleCancel handler:^(UIAlertAction *_Nonnull action) {
//当点击这个action的时候,就会回调这个block(代码块)
}];
[alertController addAction:cancelAction];
// 注意
UIAlertActionStyleCancel :如果设置action style的时候 出现两个 cancel , 就会导致崩溃
[_answerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
//是否允许用户进行交互
//一旦 父 view 被禁用,那么他的子view也将不会接收用户交互
_optionView.userInteractionEnabled = NO;
//把 iconButton (它是self.view 的子view)放到 view的最前面
[self.view bringSubviewToFront:_iconButton];
UIAlertController
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"come on!"message:@"you win!"preferredStyle:UIAlertControllerStyleAlert];
//样式:
UIAlertControllerStyleAlert : 提示框
UIAlertControllerStyleActionSheet : 从下面弹出的提示框
//想要显示alertController 必须通过下面的方法:
[selfpresentViewController:alertController animated:YEScompletion:nil];
//为alertController 添加 按钮
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"cancel"style:UIAlertActionStyleCancel handler:^(UIAlertAction *_Nonnull action) {
//当点击这个action的时候,就会回调这个block(代码块)
}];
[alertController addAction:cancelAction];
// 注意
0 0
- UIAlertController 用法简介
- UIAlertController的用法
- UIAlertController用法大全
- UIAlertController的用法示例
- iOS - UIAlertController相关用法
- UIAlertController的用法
- UIAlertController详解及用法
- UIAlertController的用法
- UIAlertController 基本用法一
- UIAlertController的用法
- UIAlertController的用法
- UIAlertController的用法
- UIAlertController的用法
- 关于UIAlertController 的一些用法
- ios9新增 UIAlertController 简单用法
- UIAlertController中TextField的用法
- UIAlertController在Swift中的用法
- UIAlertController
- 强引用、软引用、弱引用、虚引用的概念以及如何避免OOM错误
- C++实验3-个人所得税计算器
- 二叉树的基本操作(非递归前中后遍历,先序,表达式建树,复制二叉树)
- 利用qrcode生成二维码
- nginx忽略favicon.ico日志
- UIAlertController 用法简介
- RxAndroid基础
- 数据可视化教程:如何用D3操纵数据
- 面向对象三大特征,五大原则
- MySQL执行计划解读
- exp/imp与expdp/impdp区别
- java学习
- 安卓中BroadcastReceiver 注册的两种方式
- struts2的jar包下载流程