David542
David542

Reputation: 110163

Changing top bar of iphone screen (where the time and battery shows)

Is there a way to change the color color of the top bar on an iPhone that shows the battery?

My phone is showing as black text on white background but I wanted to know how to change it to white text on a black background. How would this be done?

Upvotes: 0

Views: 1522

Answers (3)

Abhinav
Abhinav

Reputation: 38162

For iOS < 7, you can use any of the below mentioned styles apart from the default ones:

[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackOpaque];
[[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

For iOS 7 follow these steps:

1. Set the UIViewControllerBasedStatusBarAppearance to YES in the plist

2. In viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate];

3. Add the following method:

-(UIStatusBarStyle)preferredStatusBarStyle{ 
    return UIStatusBarStyleLightContent; 
}

Upvotes: 0

Here try this:

- (UIStatusBarStyle)preferredStatusBarStyle {

    return UIStatusBarStyleLightContent;
}

If that doesn't work then change it in your info plist Status Bar Style to UIStatusBarStyleLightContent.

Upvotes: 0

Andrey Chernukha
Andrey Chernukha

Reputation: 21808

Try this:

if ([self.navigationController.navigationBar respondsToSelector:@selector(setTranslucent:) ])
    self.navigationController.navigationBar.translucent = NO;

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

Upvotes: 1

Related Questions