我的状态栏在 UITabBarController 的每个选项卡的根 Controller 中相应地起作用。一旦我通过带有 .overFullscreen modalPresentationStyle 的 present(viewControllerToPresent:) 向 UIViewController 添加模态,它就需要我通过发送它的 UIViewController 分配 preferredStatusBarStyle。我需要呈现的 UIViewController 具有清晰的背景并可以看到之前的 UIViewController 内容。我做错了什么吗?
最佳答案
我和 friend 一起解决了这个问题。正确答案如下:
modalViewController.modalPresentationCapturesStatusBarAppearance = true
关于ios - 为什么通过覆盖 preferredStatusBarStyle,我的 UIStatusBar 没有按预期显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49183055/