0
votes

When I override overrideUserInterfaceStyle to light and dark mode is set to on, on the device, it is not changing the status bar style to .lightcontent.

                    overrideUserInterfaceStyle = .light
                    self.navigationController?.navigationBar.largeTitleTextAttributes = [.foregroundColor: UIColor.black]
                    self.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.black]
                    self.navigationController?.navigationBar.barStyle = .default
                    self.setNeedsStatusBarAppearanceUpdate()

That is my code for overridng the interfacce style. When I do this the statusbar is staying with dark content.

1

1 Answers

0
votes

If your content is inside a UINavigationController, you won't get what you expect. You will have to subclass UINavigationController to reach into its content and promote that view controller's overridden value.

See this thread for some answers: preferredStatusBarStyle isn't called