Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting custom color of status bar text

Tags:

ios

In iOS8 I want to set the color of the status bar text (carrier, time, battery) to a custom color.

I've set View controller-based status bar appearance to NO and tried this code in both the individual viewcontroller, and the app delegate:

[[UINavigationBar appearance] setTintColor:color_font];

and

[self.navigationController.navigationBar setBarTintColor:[UIColor greenColor]];
like image 459
RParadox Avatar asked Jan 31 '26 07:01

RParadox


1 Answers

In iOS8 I want to set the color of the status bar (Carrier, time, battery) to a custom color.

This is not possible right now without using private API (Customize iOS 7 status bar text Color). You can only make the status bar's text white (UIStatusBarStyleLightContent) or black (UIStatusBarStyleDefault). Check the docs:

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/#//apple_ref/c/tdef/UIStatusBarStyle

You can put a view behind the status bar (per everyone else's answer), but I don't think that's what you're asking.

like image 55
Aaron Avatar answered Feb 02 '26 23:02

Aaron