2

My app uses a white status bar. When I launch the app from the home screen (i.e. the app goes full screen) this works fine.

If, while my app is still in full screen, I Slide Over a second app (Calendar, for instance), the status bar is still white. If I then use Split View between my app and Calendar, the status bar remains white. This is all working properly.

However, if the first full screen app is Calendar (or any other, of course) and I use Slide Over to see my app, the status bar turns to black. If I then proceed and use Split View, the status bar still shows as black. Finally, if I drag my app all the way to the left to make it go full screen, the status bar correctly turns to white.

To sum up: when having another app in full screen and using Slide Over or Split View to see my app, the status bar is displayed using the wrong color.

Is this an iOS 9 bug or am I missing something? I couldn't find anything in the docs that stated to declare the status bar color somewhere else for Slide Over/Split View.

Thanks!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
gabrielmaldi
  • 2,157
  • 2
  • 23
  • 39
  • Can you upload a screenshot? – Rich Waters Sep 20 '15 at 17:26
  • @RichWaters when I went ahead to record a video which showed what I meant, suddenly no app made active with Slide Over (and then Split View) is showing the status bar any more! This is true for my app as well as for every other Apple app (Calendar, Safari, Maps, etc.). I know I'm not crazy: I did see my app showing a black status bar, but I can't reproduce this behavior now, the status bar is only shown on the app on the left of the screen. – gabrielmaldi Sep 21 '15 at 20:29

2 Answers2

2

I fixed this issue by creating a new class inheriting from UISplitViewController and assign it as the class for your split view controller. In this class override the method preferredStatusBarStyle as follows

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

Don't actually understand why this works while changing the value in the storyboard doesn't work.

Joseph Wahba
  • 439
  • 2
  • 5
  • 16
0

Swift 3 version:

override var preferredStatusBarStyle: UIStatusBarStyle { return .lightContent }

pinzoni
  • 31
  • 2