2

Okay, so...

I have set the NavigationBar Style to Black so that the Status Bar Icons become White.

(See Pic 1 Below)

Pic 1 - Status Bar Icons White, as they Should be

The Problem begins with the Search Bar. When it's active and you can type it turns the NavigationBar Style back to Default which makes the Status Bar Icons Black again. Though once you are done with it and it goes back to being inactive, the NavigationBar Style goes back to Black, where it should be all the time.

(See Pic 2 Below)

Pic 2 - Status Bar Icons Black - Not Good

I haven't found a way yet to make the Status Bar Icons remain White at all times.

Help is much appreciated.

Dino Prašo
  • 601
  • 9
  • 22

1 Answers1

1

It sounds like you have view controller based status bar appearance setup.

If you want the status bar to be white all the time, then you can set the UIViewControllerBasedStatusBarAppearance info.plist key to NO and then set UIStatusBarStyle key to UIStatusBarStyleLightContent.

If you do want to keep view controller based status bar appearance, then you will need to subclass UISearchController and override the status bar style as you are technically presenting a different view controller for search hence the change in status bar style...

class SearchController: UISearchController {

    override func preferredStatusBarStyle() -> UIStatusBarStyle {
        return .LightContent
    }
}

(note that i assume you are using UISearchController as your question doesn't mention your approach)

liamnichols
  • 12,419
  • 2
  • 43
  • 62