My statusBar
is white regardless of the background color.
I tried this:
override var preferredStatusBarStyle : UIStatusBarStyle {
return .lightContent
}
but doesn't work for me.
My statusBar
is white regardless of the background color.
I tried this:
override var preferredStatusBarStyle : UIStatusBarStyle {
return .lightContent
}
but doesn't work for me.
Create a new swift file called PostingController.swift
class PostingController: UIHostingController<ContentView> {
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
}
Then change the line in the SceneDelegate.swift code file
window.rootViewController = UIHostingController(rootView: ContentView())
from follow lines
window.rootViewController = PostingController(rootView: ContentView())
The above answer is for SwiftUI