UIAlertController 的创建和使用
来源:互联网 发布:中国网络墙叫什么名字 编辑:程序博客网 时间:2024/06/07 02:28
1.第一种表现形式 UIAlertControllerStyleAlert<img src="http://img.blog.csdn.net/20161024165836950?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"将清除所有缓存信息" preferredStyle:UIAlertControllerStyleAlert]; //取消 UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { // 什么都不做 }]; //清除 UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"清除" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { // 清除操作 }]; [alertController addAction:cancelAction]; [alertController addAction:sureAction]; [self presentViewController:alertController animated:YES completion:^{ }];2.第二种形式 UIAlertControllerStyleActionSheet<img src="http://img.blog.csdn.net/20161024170145642?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />1.UIAlertController * alertVC = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; 2.UIAlertAction * cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]; UIAlertAction * photoAction = [UIAlertAction actionWithTitle:@"拍摄视频" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { * 调用相机拍 }];UIAlertAction * chosePictureFromUser = [UIAlertAction actionWithTitle:@"选择视频" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { * 从相册中选取 }];3. [alertVC addAction:cancelAction]; [alertVC addAction:photoAction]; [alertVC addAction:chosePictureFromUser];4.[self presentViewController:alertVC animated:YES completion:nil];
0 0
- UIAlertController 的创建和使用
- UIAlertController和UIImagePickerController的使用
- UIAlertController 和 UIAlertView的使用
- UIAlertView和UIAlertController的使用
- iOS开发 UIAlertController的创建与使用
- UIAlertController和UIAlertAction的简单使用
- UIAlertController的使用——创建提示窗口
- ios中UIAlertController的使用创建对话框、操作表
- UIAlertController的使用(Swift)
- UIAlertController的使用示例
- UIAlertController的使用二
- UIAlertController的使用
- UIAlertController的使用
- 关于UIAlertController的使用
- UIAlertController的使用
- UIAlertController 的使用
- UIAlertController 的使用
- UIAlertController的使用
- 欢迎使用CSDN-markdown编辑器
- 理解离散傅立叶变换(一)
- Monkey使用
- 创建maven项目报错Unable to create project from archetype
- Appscan使用外部浏览器
- UIAlertController 的创建和使用
- jQuery 遍历 - 同胞
- ImageLoader
- 手机屏幕适配的一种方法
- the following untracked working tree files would be overwritten by merge:
- C语言实验——打印数字图形
- springmvc
- Linux下chkconfig命令详解
- JIRAjira安装