我用弹出式程序打开一个页面,应用的主题是浅色的,所以状态栏的标签是黑色的。但是当打开popover后,状态栏的标签也变成了白色,状态栏里什么都看不到了。起初我以为是弹出式页面的问题,但很明显,当后台页面下来后,状态栏的色调发生了变化。https:/streamable.comhvjl4
如何才能防止这种情况的发生。
在应用程序中, preferredStatusBarStyle
是白色的,除了这种情况,在任何页面都可以使用。
以下是打开popover的代码
func showlistCard() {
let vc = ContainerlistCard()
vc.modalPresentationStyle = .popover
present(vc, animated: true, completion: nil)
}
有什么建议吗
添加这行 ContainerListCard
阶层 viewDidLoad()
modalPresentationCapturesStatusBarAppearance = true