Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

White status bar

How do I make the status bar text white in xcode 5 for ios 7?

2 Answers

If you're using a UINavigationController then put this code in the -viewDidLoad method of your initial view controller.

I am just using a single view.

Try this then in the -viewDidLoad method.

[UIApplication sharedApplication].statusBarStyle = UIBarStyleBlack;

It still has not changed. od i need to do something elsewhere?

OK, try adding the following method to your view controller.

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}

PERFECT!! Thank you! I am also having difficulties with iAds since i have opened my app in xcode 5. Is there a quick fix for this?

To make the status bar text white you need to set the -barStyle on the UINavigationBar to UIBarStyleBlack.

self.navigationController.navigationBar.barStyle = UIBarStyleBlack;

Where do I put this code?