23

As shown on Apple's September 2012 keynote, the status bar tint color varies between apps in iOS 6. For instance, Safari and Maps use a black status bar whereas Mail adds a blue tint to it.

Is it possible to set that tint color, or at least force it to black?

Anton
  • 5,932
  • 5
  • 36
  • 51
  • I'm going completely off memory, but I think iOS has always had this. It's set somewhere in your application's pList. – slugonamission Sep 17 '12 at 22:11
  • It has only been possible to set it to default or black color as far as I know. The blue color in the Mail app hasn't been available. – Anton Sep 17 '12 at 22:15
  • 2
    Sorry, but the iOS 6 SDK is still under NDA until it is available to non-paying app developers. – Dave DeLong Sep 17 '12 at 22:18
  • 2
    The iOS 5 SDK may still have methods for affecting the status bar color on iOS 6 in a way that's already demonstrated by Apple. I believe my question doesn't break the NDA and that an answer doesn't have to either. – Anton Sep 17 '12 at 22:25
  • 1
    I recommend you poke around inside your developer portal to find the answer to this one, and I'd take Dave's correct advice if I were you. He works for Apple after all. – Mick MacCallum Sep 17 '12 at 23:10
  • @AntonHolmquist - aha, sorry, that's what I was thinking of, sorry – slugonamission Sep 18 '12 at 07:00
  • Hooray, we can now ask this question! :) – Dave DeLong Sep 20 '12 at 19:17

6 Answers6

28

You can do it from the plist like Comradsky mention or in xcode 4.5, they added an option for it in the project summary.

enter image description here

Update:

several people were confused by this answer. Just to clarify, you cannot set the status bar tint to any color you want. What is described above is only to change the status bar tint during launch and choose the iOS 6 default status bar color behavior (which picks the color of the bottom row of pixels from your navigation bar).

KDaker
  • 5,899
  • 5
  • 31
  • 44
  • 12
    This only seems to set the launch image status bar colour, not when your app actually finishes launching. – KSchmidt Sep 26 '12 at 22:36
  • it works fine for the entire app if you set Tinting to 'Default' or 'custom color' .. you probably need to delete or change the 'Status bar style' entry from your plist though. In my app it was set to blackOpaque and it was overriding the project settings. After i deleted it, the tinting options worked. – KDaker Sep 26 '12 at 23:04
  • I tried that, and it does not tint the status bar for app beyond the startup phase. From the Apple release notes: "You might do this to ensure that the status bar color matches the navigation bar color of your app **during startup**." – KSchmidt Sep 26 '12 at 23:14
  • well on default, the status bar color should be changing according to your nav bar's color. isnt that working?? – KDaker Sep 26 '12 at 23:20
  • 5
    From my analysis, if you have a custom nav bar background image, it uses the average colour from the 41st row (non-retina). I wish I was making this up. – KSchmidt Sep 26 '12 at 23:33
  • I was able to get it working by following this approach even though I am not using PhoneGap, http://moduscreate.com/tinting-your-status-bar-in-ios6-and-phonegap/ – Chris Wagner Sep 27 '12 at 03:00
  • 1
    @KSchmidt make sure that your "first Controller" has the top Bar set to "Navigation Bar" and Status Bar set to "Inferred" – MUH Mobile Inc. Oct 10 '12 at 19:09
  • @ChrisWagner - yes, navbar colour tinting works. I am using a custom navbar background image. Still, setting the project tint information doesn't work for anything but startup. – KSchmidt Oct 13 '12 at 05:46
  • @Muhaye I have those settings - makes no difference. – KSchmidt Oct 13 '12 at 05:46
  • 8
    why was this chosen as the correct answer? it doesn't work for me... it only sets the status bar color during startup... – Cashew Oct 14 '12 at 20:29
11

I've just found how to do it !

  1. In your "Project Summary", in "Status Bar", set "Style" and "Tinting" to "Default.
  2. Then, jump into you xib or storyboard and add a UINavigationBar just below the status bar.
  3. Set the UINavigationBar "Style" to "Default" and select the "Tinting" of your choice.
  4. Run! :-)

If, like me, you don't want any UINavigationBar visible in your Interface, all you want to do is putting the UINavigationBar behind all the Objects, or set the "Alpha" to zero.

Mundi
  • 79,884
  • 17
  • 117
  • 140
  • 1
    This didn't work for me, this did and seems very obvious [http://stackoverflow.com/questions/12965214/status-bar-tint-color-changes-to-black-in-ios-6](http://stackoverflow.com/questions/12965214/status-bar-tint-color-changes-to-black-in-ios-6) – Nick Apr 13 '13 at 17:57
8

You can do that in a tricky way..

  • In the Project Summary select Status Bar Style Black Transculent from the drop down menu.
  • In application: didFinishLaunchingWithOptions: enter the following line of code:

    self.window.backgroundColor = [UIColor greenColor]; //example color

It works fine for me.

Vineeth
  • 1,720
  • 1
  • 16
  • 23
2

The tint color seems to be determined by the average color of the bottom pixel row of the app's header bar.

See here: http://www.cultofmac.com/173928/how-ios-6s-cool-new-adaptive-status-bar-works/

Twilite
  • 873
  • 9
  • 22
  • That didn't work for me - after experimentation I arrived at the conclusion that the status bar colour will use the average of last 3 rows of pixels from a custom navbar background image (non-retina). – KSchmidt Sep 26 '12 at 22:35
  • Actually, the 3rd-last row seems to be the only that makes a difference :/ – KSchmidt Sep 27 '12 at 01:23
2

It is very easy to do: just put up an UINavigationBar in your .xib/storyboard, make sure the style is default. then add a tint. no matter how many views, with different tinted UINavigationBar's, you have your status bar will change its color.

PiView
  • 21
  • 1
1

There is no way in iOS 5. You can just change your bar style. In iOS 6 you can do it in the info.plist:

It is now possible to set status bar tint parameters in your app’s Info.plist file. You might do this to ensure that the status bar color matches the navigation bar color of your app during startup. To set the status bar tint, add the UIStatusBarTintParameters key to your Info.plist file. The value of this key is a dictionary with the appropriate values describing the navigation bar your app has at startup time. Inside the dictionary should be the UINavigationBar key, whose value is also a dictionary. That dictionary contains the initial navigation bar’s style (with the Style key) and whether it’s translucent (with the Translucent key). If your navigation bar uses them, you can also specify its tint color (with the TintColor key), or the name of its custom background image (with the BackgroundImage key).

Check out this link here Edit:You can also do this in the project summary.

SkylerHill-Sky
  • 2,106
  • 2
  • 17
  • 33