UIAlertView 和 UIAlertController
来源:互联网 发布:罗格朗开关质量 知乎 编辑:程序博客网 时间:2024/06/10 20:02
二者都可实现弹窗功能:
UIAlertView:
//用button触发- (void)button{ UIAlertView *alterView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"网络不给力...." delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"继续",@"再试一次", nil]; [alterView show];}
UIAlertController
- (void)button{ UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"提示" message:@"网速不给力..." preferredStyle:(UIAlertControllerStyleAlert)]; [self presentViewController:controller animated:YES completion:nil]; UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:nil]; UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"继续" style:(UIAlertActionStyleDefault) handler:nil]; UIAlertAction *action3 = [UIAlertAction actionWithTitle:@"再试一次" style:(UIAlertActionStyleDestructive) handler:nil]; [controller addAction:action1]; [controller addAction:action2]; [controller addAction:action3];}
二者区别和联系
0 0
- UIAlertView 和UIAlertController二合一
- UIAlertView 和 UIAlertController
- UIAlertController和UIAlertView
- UIAlertController 和 UIAlertView的使用
- UIAlertView和UIAlertController的使用
- UIAlertView和UIAlertController的封装
- UIAlertController,取代UIAlertView和UIActionSheet
- 【UI进阶】UIAlertController替代UIAlertView和UIActionSheet
- IOS UIAlertView和UIAlertController学习记录
- OC中UIAlertController和UIAlertView用法
- IOS-UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS--UIAlertView与UIAlertController和UIAlertAction
- UIAlertView和UIAlertController那点事儿
- UIAlertView以及UIAlertController
- UIAlertView变成了UIAlertController
- UIAlertController与 UIAlertView
- UIAlertController(UIActionSheet、UIAlertView)
- 浅谈UIAlertView与UIAlertController
- python异常处理
- linux 内核链表的应用
- java 获取上一周周一到周日的日期
- AJAX(二)jquery ajax
- Dojo -- Getting Started篇之dojoConfig
- UIAlertView 和 UIAlertController
- ajax jsp 无刷新上传文件
- ruby 入门实例
- PHP 命名空间 解惑
- XYLX 10.19 H1N1(h1n1)
- iOS9 定位遇到的一点问题
- BUG修改记录
- UITableViewCell的accessoryType属性
- js的defer属性