美文网首页
调用UIAlertController时为其添加action使按

调用UIAlertController时为其添加action使按

作者: qqqqnnnndddd | 来源:发表于2019-03-22 11:59 被阅读0次

创建UIAlertController时 addAction: 使只做信息展示和按钮展示,不添加按钮响应事件

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"xxxx" message:@"他大大爷和他二大爷都是他大爷" preferredStyle:UIAlertControllerStyleAlert];

        UIAlertAction *updateAction = [UIAlertAction actionWithTitle:@"xxxx" style:UIAlertActionStyleDefault handler:nil];

        [alert addAction:updateAction];

        alert.view.userInteractionEnabled = NO;

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

相关文章

网友评论

      本文标题:调用UIAlertController时为其添加action使按

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