美文网首页
自定义弹框(配合按钮使用)

自定义弹框(配合按钮使用)

作者: 朕i | 来源:发表于2018-10-08 10:52 被阅读0次

UIAlertController *alert = [UIAlertController alertControllerWithTitle:self.textLabel.text message:self.detailTextLabel.text preferredStyle:UIAlertControllerStyleAlert];

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

        NSLog(@"关了");

    }];

    [alertaddAction:alertAction];

    [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:alert animated:YES completion:^{

        NSLog(@"弹出来了");

    }];

相关文章

网友评论

      本文标题:自定义弹框(配合按钮使用)

      本文链接:https://www.haomeiwen.com/subject/jbpdaftx.html