繁体   English   中英

当我仍然可以看到背景viewController时,如何呈现viewController

[英]How to present viewController while I can still see the background viewController

例如,当我显示UIActivityViewController或UIAlertController时,仍然可以看到背景viewController,并且我不想在viewContollerA中嵌入viewControllerB。

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

您可以为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];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM