Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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?