JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.24k stars 1.11k forks source link

Cannot change preferredStatusBarStyle on ComposeUIViewController #4889

Closed chokokatana closed 3 weeks ago

chokokatana commented 4 weeks ago

The usual way to change the status bar style on iOS is to override the var preferredStatusBarStyle:

override var preferredStatusBarStyle: UIStatusBarStyle {
     return .lightContent
}

override func viewDidLoad() {
    super.viewDidLoad()

    setNeedsStatusBarAppearanceUpdate()
}

However, ComposeUIViewController() returns a final UIViewController and there is no way to change this value. Maybe ComposeUIViewControllerConfiguration could grow extra nullable blocks that could be implemented to provide extra customization.

elijah-semyonov commented 4 weeks ago

I'll forward this API, as a temporary workaround, you can wrap your ComposeUIViewController into UIViewController with overriden properties