如何呈现viewController,我仍然可以看到后台viewController

时间:2015-10-28 02:28:11

标签: ios objective-c uialertcontroller

例如,当我呈现UIActivityViewController或UIAlertController时,我仍然可以看到后台viewController,我不想在viewContollerA中嵌入viewControllerB。

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:0)

你可以为UIAlertController实现这样的实现

    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Title" message:@"Message" preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel " style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {
        NSLog(@"cancel");
    }];
    [alertController addAction:cancelAction];
    [self presentViewController: alertController animated:YES completion:nil];