UIAlertAction 弹出对话框9.0后有点变化
2015-12-02 11:54
375 查看
ios 9.0后再用以前的UIAlertAction 已经不行了 被弃用了 改用这种方法了
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示"message:@"什么怎么怎么样"preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSLog(@"点击取消按钮执行");
}];
UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSLog(@"点击确定按钮执行");
}];
[alertController addAction:cancelAction];
[alertController addAction:otherAction];
[self presentViewController:alertController animated:YES completion:nil];
对里面的确定 取消按钮 执行方法 简单 直白
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示"message:@"什么怎么怎么样"preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSLog(@"点击取消按钮执行");
}];
UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSLog(@"点击确定按钮执行");
}];
[alertController addAction:cancelAction];
[alertController addAction:otherAction];
[self presentViewController:alertController animated:YES completion:nil];
对里面的确定 取消按钮 执行方法 简单 直白
相关文章推荐
- 对chain.doFilter(request,response)的理解
- 自增主键@GeneratedValue、@SequenceGenerator
- UIRefreshControl 下拉刷新
- 并发队列ConcurrentLinkedQueue和阻塞队列LinkedBlockingQueue用法
- UITextField 被键盘挡住时自动上移调整textField frame
- 【IOS】NSUInteger
- iOS uibutton 上下按钮样式
- error for Tiwsted: Twisted requires zope.interface 3.6.0
- Sqlserver Sequence操作
- [POJ]2533 Longest Ordered Subsequence
- 使用vim-gui-common实现从vim窗口复制内容到系统剪贴板
- UEFI 、GPT 分区安装 Windows10
- EasyTouch与UGUI的结合
- UGUI世界坐标转屏幕坐标
- 交互设计:隐藏或显示大段文本的UI组件有哪些?
- 跨境电商到底算不算走私
- 问题1-The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
- 使用AutoLayout添加UIScrollView
- $_SERVER['PHP_SELF']、$_SERVER['SCRIPT_NAME'] 与 $_SERVER['REQUEST_URI']区别
- NO.3- UIControl(控制类)