iOS Question [SOLVED] How to set color of status bar?


Licensed User
This is regarding me making my own navbar (see this thread for more info).

Normally the status bar piggybacks on the color of the navigation bar. In my case I'm building my own navigation bar, which means I'm hiding the real one. And when I hide the real one, the status bar doesn't pick up the (disabled) navigation bar color.

Which brings me to my question: How to set the color (both background and text color) of the status bar?

I found a web page showing how to do this (at least the background) using Swift, but I don't really grasp how to turn this into B4i code... :-/

This is the Swift code:
UIApplication.shared.statusBarView?.backgroundColor = UIColor.white

And here are some examples from that page, showing different results:






Licensed User
A follow-up to people finding this thread:

As I'm using a somewhat dark color for my status bar, I needed to change the black status bar text color to make it readable. Apple only allows this text to be either black or white, and thanks to this post by @JanPRO, I learned that it can be controlled using PlistExtra in B4i:



And this is where we do need the key that Erel posted about in #2. (If one leaves it out, the app crashes.)
Upvote 0