UIAlertController设置
来源:互联网 发布:己知阴影面积为10dm 编辑:程序博客网 时间:2024/06/03 20:16
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"title" message:@"message" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *alertAction){
NSLog(@"如果你是iOS8以上的应用,这个适合你,简单明了");
}];
[alertController addAction:cancelAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction *alertAction){
NSLog(@"如果你是iOS8以上的应用,这个适合你,简单明了");
}];
[alertController addAction:cancelAction];
[alertController addAction:okAction];
1. [self presentViewController:alertController animated:YES completion:nil];
2.[alertController.view setNeedsLayout];
以上两个必须写一个,不然会报错:Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<UIAlertController: 0x7f84e25b22b0>)
0 0
- UIAlertController设置
- App设置UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIalertController
- UIAlertController
- UIalertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- 第九周项目36-阅读程序,写出执行结果(1)
- (OK) dnf - Fedora23——删除多余不用的内核
- 正则表达式知识详解之实战 读取网页中超链接 (java版示例)
- 育儿
- 服务器禁PING简述
- UIAlertController设置
- ASP.NET MVC 网站开发总结(二)——一个或多个文件的异步或同步上传
- JAVA定时器启动日期
- 用getChildFragmentManager解决Fragment嵌套Fragment数据丢失的问题
- 数组中第k大(或小)的元素(leetcode215)
- 数据库中四种常用的连接语句
- 《高性能JavaScript》摘要
- Java 访问权限问题
- 找出一组数中只出现一次的数1