1

在 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 引起的。

任何想法?谢谢。

4

3 回答 3

0

@Antonio Ureba

尝试演示风格

UIModalPresentationStyle.overFullScreen
于 2019-11-22T12:29:33.140 回答
0

代替

homeVC.modalPresentationStyle = UIModalPresentationFullScreen;

homeVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
于 2019-11-22T12:36:29.167 回答
-1

尝试设置背景颜色,我也面临黑屏,但我通过更改背景颜色来修复它

view.backgroundColor = UIColor.white

于 2019-11-22T23:46:22.073 回答