Reputation: 129
I open a page programmatically with popover, the theme of the app is light so the status bar labels are black. But when the popover gets open, the the labels are status bar also gets white and nothing can be seen in the status bar.
here is the screenshot link
here is the code to open popover
func showlistCard() {
let vc = ContainerlistCard()
vc.modalPresentationStyle = .popover
present(vc, animated: true, completion: nil)
}
Then I searched, and I found out that I can change the style of status bar with these code
public override var preferredStatusBarStyle: UIStatusBarStyle {
return .default
}
and in the viewWillAppear
if #available(iOS 13.0, *) {
overrideUserInterfaceStyle = .light
}
I added it in both page, the page that open the popover and the page that gets opened, both of them are not working for me. Any suggestion? many thanks
Upvotes: 1
Views: 105
Reputation: 16341
If you are trying to set the status bar for the entire app all you need to do is:
View controller-based status bar appearance
to NO
Upvotes: 0