码迷,mamicode.com
首页 > 移动开发 > 详细

iOS弹窗UIAlertAction用法

时间:2019-10-15 19:02:16      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:view   des   ati   null   title   LEDE   ios   mes   action   

 1 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"确认" message:@"确认删除吗?" preferredStyle:UIAlertControllerStyleAlert];
 2     
 3     UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
 4         //取消处理
 5     }];
 6     
 7     UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
 8         //确认处理
 9     }];
10     
11     [alert addAction:action1];
12     [alert addAction:action2];
13     [self.navigationController presentViewController:alert animated:YES completion:nil];

 

iOS弹窗UIAlertAction用法

标签:view   des   ati   null   title   LEDE   ios   mes   action   

原文地址:https://www.cnblogs.com/luoluosha/p/11679497.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!