status bar text colour

Does any one have any ideas as to how I can change the colour of the text in the iphone status bar.  I know that the background is translucent but the text is always black.  Different sections of my app have different status bar colours.  These colours extend behind the status bar and look great when the colour is fairly light.  But some of the colours I want to use are darker and then the black text becomes almost impossible to see.

Looking at other apps the text colour should be changeable between black and white.  I want to set the text colour on the darker pages so that it can be seen.

Any ideas?  I’ve tried searching but can’t find anything that relates to the colour of the text.

Cheers,

Mark

Hi Mark,

You can’t directly set the text color of the status bar in Corona, but you can set different styles using the following command, documented here:

http://docs.coronalabs.com/api/library/display/setStatusBar.html

Hope this helps,

Brent

Unfortunately Brent the documentation is not up to date with ios7. On ios7 the text can be white or black. None of the options in the documentation seem to fit (or actually make a difference in practice.)

What’s really annoying is that my splash screen has a status bar with white text but the app has a status bar with black text. So obviously corona has a way of picking which, but i can’t figure out how to do it programmatically.

I could lose the status bar completely and if I can’t find a way to make setStatusBar select the correct status bar, that’s probably what I’ll do.

This is another of the little annoyances in an otherwise positive experience using corona.

Thanks anyway though Brent.

Mark

Hi Mark,

Can you install and run the StatusBar sample app on your iOS device and observe the options? It’s located in your local application folder here:

CoronaSDK > SampleCode > Interface > StatusBar

I understand the options aren’t vast, but “default” should look fine on dark background, and “dark” should look fine on a light background.

Take care,

Brent

Ok, will do, next time I’m at my mac. I’ll report back when I’ve tried it.

Thanks

Mark

I’ve just tested the options and it seems that default gives the same result as dark.  But translucent gives me the white text i was looking for so i’m happy.  Not sure why translucent didn’t work for me before.  Oh well, I obviously made a mistake.

Thanks for your help

Mark

Hi Mark,

You can’t directly set the text color of the status bar in Corona, but you can set different styles using the following command, documented here:

http://docs.coronalabs.com/api/library/display/setStatusBar.html

Hope this helps,

Brent

Unfortunately Brent the documentation is not up to date with ios7. On ios7 the text can be white or black. None of the options in the documentation seem to fit (or actually make a difference in practice.)

What’s really annoying is that my splash screen has a status bar with white text but the app has a status bar with black text. So obviously corona has a way of picking which, but i can’t figure out how to do it programmatically.

I could lose the status bar completely and if I can’t find a way to make setStatusBar select the correct status bar, that’s probably what I’ll do.

This is another of the little annoyances in an otherwise positive experience using corona.

Thanks anyway though Brent.

Mark

Hi Mark,

Can you install and run the StatusBar sample app on your iOS device and observe the options? It’s located in your local application folder here:

CoronaSDK > SampleCode > Interface > StatusBar

I understand the options aren’t vast, but “default” should look fine on dark background, and “dark” should look fine on a light background.

Take care,

Brent

Ok, will do, next time I’m at my mac. I’ll report back when I’ve tried it.

Thanks

Mark

I’ve just tested the options and it seems that default gives the same result as dark.  But translucent gives me the white text i was looking for so i’m happy.  Not sure why translucent didn’t work for me before.  Oh well, I obviously made a mistake.

Thanks for your help

Mark