首页 > 解决方案 > 更改 Storybord 视图控制器时 iOS 13 中的黑屏

问题描述

在 iOS 13 中,当我调用其他 StoryBoard 时,为 ViewController 充电时,我的视图上出现黑屏。

我使用此代码调用新的 StoryBoard:

UIStoryboard *homeSB = [UIStoryboard storyboardWithName:SBNameHome bundle:nil];
UIViewController *homeVC = [homeSB instantiateInitialViewController];
homeVC.modalPresentationStyle = UIModalPresentationFullScreen;
homeVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

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

这个项目使用多个 StoryBoard,当我调用一个新的 StoryBoard 时失败。如果我用 Xib 构建一个新的 ViewController,不会出现黑屏,但是该项目是用多个 StoryBoard 而不是 Xib 构建的。我认为这是由 iOS 13 中的新 SceneDelegate 引起的。

任何想法?谢谢。

标签: iosstoryboardios13xcode11uiscenedelegate

解决方案


@Antonio Ureba

尝试演示风格

UIModalPresentationStyle.overFullScreen

推荐阅读