为什么我的UIStatusBar没有通过覆盖首选状态栏样式显示所需的内容



我的状态栏在我的UITabBarController的每个选项卡中的根控制器中相应地起作用。一旦我通过 present(viewControllerToPresent:( 向 UIViewController 添加一个模态使用.overFullscreen modalPresentationStyle,它要求我通过发送它的UIViewController分配首选状态栏样式。我需要呈现的UIViewController具有清晰的背景,并透视以前的UIViewControllers内容。我做错了什么吗?

我和一个朋友解决了这个问题。正确答案如下:

modalViewController.modalPresentationCapturesStatusBarAppearance = true

最新更新