在iOS 8后使用UIAlertController
来源:互联网 发布:sqlserver时间比较 编辑:程序博客网 时间:2024/06/05 20:54
创建实例
UIAlertController *alertController = [UIAlertControlleralertControllerWithTitle:@"标题"message:@
"这个是UIAlertController的默认样式"
preferredStyle:UIAlertControllerStyleAlert];
preferredStyle 选择类型
UIAlertControllerStyleActionSheet=0,
UIAlertControllerStyleAlert
UIAlertAction *cancelAction = [UIAlertActionactionWithTitle:@"取消"style:UIAlertActionStyleCancelhandler:nil];
UIAlertAction *okAction = [UIAlertActionactionWithTitle:@"好的"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction *action) {
[collectionView reloadItemsAtIndexPaths:@[indexPath]];
}];
[alertController addAction:cancelAction];
[alertController addAction:okAction];
[selfpresentViewController:alertControlleranimated:YEScompletion:nil];
文本对话框:
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField){
textField.placeholder =@"登录";
}];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder =@"密码";
textField.secureTextEntry =YES;
}];
UIAlertAction *okAction = [UIAlertActionactionWithTitle:@"好的"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction *action) {
UITextField *login = alertController.textFields.firstObject;
UITextField *password = alertController.textFields.lastObject;
...}]
- 在iOS 8后使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 在iOS 8中使用UIAlertController
- 【已解决】GET方法的参数中处理URL特殊字符&%等
- 时间戳-timestamp
- python list中append()与extend()用法
- 线程池的应用和解析
- git学习日志
- 在iOS 8后使用UIAlertController
- 计算机网络探究(二)TCP的连接和终止
- String详解(二):StringBuilder和StringBuffer的区别
- 黑马程序员:福利来袭!网络安全斗鱼直播“录像+资源”大放送
- scikit-learn多分类probility输出
- 不使用用库函数将整数转换为字符串
- zabbix企业应用之监控docker容器资源情况
- redis之二字符串
- poj1177 线段树 + 扫描线