UIAlertViewController的使用方法
来源:互联网 发布:淘宝怎么换购产品 编辑:程序博客网 时间:2024/06/06 08:46
UIAlertController *alertcontroller = [UIAlertController alertControllerWithTitle:@"你" message:@"杀人啦" preferredStyle:(UIAlertControllerStyleAlert)];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击“确定”后执行");
}];
UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击“取消”后执行");
}];
UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"啊啊" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击“啊啊”后执行");
}];
[alertcontroller addAction:action2];
[alertcontroller addAction:action];
[alertcontroller addAction:action1];
[alertcontroller addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {//UIAlertControllerStyleAlert情况下使用
textField.placeholder = @"登录";
}];
[alertcontroller addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"啊啊";
}];
[self presentViewController:alertcontroller animated:YES completion:nil];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"确定" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击“确定”后执行");
}];
UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击“取消”后执行");
}];
UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"啊啊" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击“啊啊”后执行");
}];
[alertcontroller addAction:action2];
[alertcontroller addAction:action];
[alertcontroller addAction:action1];
[alertcontroller addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {//UIAlertControllerStyleAlert情况下使用
textField.placeholder = @"登录";
}];
[alertcontroller addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"啊啊";
}];
[self presentViewController:alertcontroller animated:YES completion:nil];
0 0
- UIAlertViewController的使用方法
- iOS 9 的 UIAlertViewController
- iOS8之后的UIAlertViewController
- UIAlertViewController
- UIAlertViewController
- UIAlertViewController
- 提示框的综合使用--UIAlertViewController
- 用runtime自定义UIAlertViewController的字体大小和颜色
- iOS8- UIAlertViewController
- UIAlertViewController详解
- iOS8- UIAlertViewController
- KVO 和 UIAlertViewController
- 使用UIAlertviewController弹出视图
- iOS UIALertViewController常用方法
- Swift 提示框 UIAlertViewController
- 自定义UIAlertViewController选择视图
- 在iOS8中使用UIAlertViewController
- iOS之UIAlertViewController精简使用
- Python微悟(一)
- 【iOS】判断viewcontroller 来源(展示出来)的4个方法
- Android中插件开发篇之----应用换肤原理解析
- extjs 必须项目前面红色星号
- Spring 学习笔记 (I) 之 Spring IoC
- UIAlertViewController的使用方法
- scheme,host,port,mimeType,path,pathPrefix,pathPattern用法
- 内存或磁盘空间不足,Microsoft Office Excel 无法再次打开或保存任何文档
- 快速开发框架dhroid的使用
- mysql进阶(十七)Cannot Connect to Database Server
- 利用LVM制作大容量分区
- swift 学习记录(继承)
- HTTP笔记(一)基本介绍
- UI测试