UIAlertController使用
来源:互联网 发布:mac口红brave red试色 编辑:程序博客网 时间:2024/05/03 18:46
1、替代UIAlertView
代码:
if(SYSTEM_VERSION >= 8.0) { UIAlertController * alertCtr = [UIAlertController alertControllerWithTitle:@"" message:@"删除联系人?" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *firstAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { //do something }]; UIAlertAction *secondAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { //do something }]; [alertCtr addAction:firstAction]; [alertCtr addAction:secondAction]; [self presentViewController:alertCtr animated:YES completion:^{ }]; }
2、替代UIActionSheet
代码:
if(SYSTEM_VERSION >= 8.0) { UIAlertController * alertCtr = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *firstAction = [UIAlertAction actionWithTitle:@"回复" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { //do something }]; UIAlertAction *secondAction = [UIAlertAction actionWithTitle:@"转发" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { //do something }]; UIAlertAction *thirdAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { //do something }]; [alertCtr addAction:firstAction]; [alertCtr addAction:secondAction]; [alertCtr addAction:thirdAction]; [self presentViewController:alertCtr animated:YES completion:^{ }]; }
0 0
- UIAlertController使用
- UIAlertController 使用
- UIAlertController使用
- UIAlertController使用
- UIAlertController使用
- UIAlertController使用
- UIAlertController使用
- UIAlertController使用
- UIAlertController的使用(Swift)
- UIAlertController的使用示例
- UIAlertController的使用二
- UIAlertController的使用
- UIAlertController的使用
- 关于UIAlertController的使用
- UIAlertController的使用
- UIAlertController 的使用
- UIAlertController 的使用
- UIAlertController的使用
- Subsets II
- Opencv字体操作和设置
- 如何一个android工程作为另外一个android工程的lib
- 谈谈我所知道的API写法
- 修改tabhost的字体样式(颜色、字体大小) (有个R.id.title的问题)
- UIAlertController使用
- JAVA之代码混淆proguard基础(二)
- IOS学习十四:网络之ASIHttpRequest和SBJson简单使用
- 自定义ListView滚动条式样
- 将图片转成二进制并生成Base64编码,可以在网页中通过url查看图片
- 判断 手机有没虚拟按键
- 如何检查一个档案是否被异动过,使用 MD5
- extern "C"用法解析
- 理解 Objective-C Runtime