首页 > 其他 > 详细

UIAlertController使用

时间:2017-01-05 08:58:20      阅读:175      评论:0      收藏:0      [点我收藏+]
    //1创建弹框控制器
    UIAlertController *alertVc = [UIAlertController alertControllerWithTitle:@"亲,确定要滚吗?" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
    //2.1添加确定事件
    UIAlertAction *sureBtn = [UIAlertAction actionWithTitle:info style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
        // 回到登录界面
        [self.navigationController popViewControllerAnimated:YES];
    }];
    [alertVc addAction:sureBtn];
    //2.2添加取消事件
    UIAlertAction *cancelBtn = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
        NSLog(@"---点击了取消按钮");
    }];
    [alertVc addAction:cancelBtn];
    //3展示控制器
    [self presentViewController:alertVc animated:YES completion:nil];

 

UIAlertController使用

原文:http://www.cnblogs.com/dzq1991/p/6251041.html

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