UIAlertController的用法
来源:互联网 发布:网络电视剧收视率 编辑:程序博客网 时间:2024/05/18 22:46
ios8不用于以前,uiAlertController属于UIViewController,而以前UIAlertView是属于UIView的。
//添加对话提示框
UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:@"提示" message:@"请选择”"preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"确定"style:UIAlertActionStyleDestructivehandler:^(UIAlertAction * action) {}];
[actionSheetController addAction:actionCancel];
[actionSheetController.view setTintColor:[UIColor redColor]];
[self presentViewController:actionSheetController animated:YES completion:nil];
用法二---多选项
UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:@"action选项" message:nilpreferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *action0 = [UIAlertAction actionWithTitle:@"选项一" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[self customMethod1];
}];
[actionSheetController addAction:action0];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"选项二" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[self <span style="font-family: Arial, Helvetica, sans-serif;">customMethod2</span>];
}];
UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"选项三" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
[self customMethod3];
}];
UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {}];
[actionSheetController addAction:action];
[actionSheetController addAction:action1];
[actionSheetController addAction:actionCancel];
[actionSheetController.view setTintColor:[UIColor greenColor]];
[self presentViewController:actionSheetController animated:YES completion:nil];
- UIAlertController的用法
- UIAlertController的用法示例
- UIAlertController的用法
- UIAlertController的用法
- UIAlertController的用法
- UIAlertController的用法
- UIAlertController的用法
- UIAlertController的用法
- 关于UIAlertController 的一些用法
- UIAlertController中TextField的用法
- ios9 xcode7 UIAlertController的常用用法
- UIAlertController用法大全
- iOS - UIAlertController相关用法
- UIAlertController详解及用法
- UIAlertController 用法简介
- UIAlertController 基本用法一
- UIAlertController的用法以及和其与UIAlertView的区别
- iOS 9 UIAlertController 简单的介绍和用法
- [跨域] -- cookie跨域共享
- 记一次 Data Binding 在 library module 中遇到的大坑
- windows删除“找不到该项目”的文件
- Xposed开发指南
- The Free Lunch Is Over - Bombe
- UIAlertController的用法
- CSS实现的几款不错的菜单栏
- 面向对象设计原则
- 计算机网络粗略概括
- react-dom 的 renderToString 与 renderToStaticMarkup (转载)
- C枚举类型
- 总结:JAVA小项目——图书管理系统
- 小人儿的笔记(AngularJS)--03
- 从零开始的Android新项目11 - 组件化实践(1)