首页 > 其他 > 详细

UIAlertAction 弹出对话框9.0后有点变化

时间:2015-12-02 14:09:22      阅读:235      评论:0      收藏:0      [点我收藏+]

ios 9.0后再用以前的UIAlertAction 已经不行了 被弃用了 改用这种方法了

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示"message:@"什么怎么怎么样"preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

NSLog(@"点击取消按钮执行");

}];

UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

NSLog(@"点击确定按钮执行");

}];

[alertController addAction:cancelAction];

[alertController addAction:otherAction];

[self presentViewController:alertController animated:YES completion:nil];

对里面的确定 取消按钮 执行方法 简单 直白

UIAlertAction 弹出对话框9.0后有点变化

原文:http://www.cnblogs.com/daijiahong/p/5012543.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!