Black
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
White
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
However I would like to know can I set some other color? Really I want this because all my app design goes ugly with white and black ;(
I know this is not possible, but still asking here as someone might know if there is way.
Now, if there is no way, what I am planning is to create custom view and put all what I see in status bar to my view as below, but black to green color.

Is there any way where I can gather all the information of status bar?
I will manage to refresh the view based on notification, but I want to find the way where we can gather all contents of status bar.
And most important, is it allowed?
What I wanted is as below.

From the link provided by MidhunMP, I used as below.
/// sets the status bar text color. returns YES on success.
/// currently, this only
/// works in iOS 7. It uses undocumented, inofficial APIs.
BOOL setStatusBarColor(UIColor *color)
{
id statusBarWindow = [[UIApplication sharedApplication] valueForKey:@"statusBarWindow"];
id statusBar = [statusBarWindow valueForKey:@"statusBar"];
SEL setForegroundColor_sel = NSSelectorFromString(@"setForegroundColor:");
if([statusBar respondsToSelector:setForegroundColor_sel]) {
// iOS 7+
[statusBar performSelector:setForegroundColor_sel withObject:[UIColor colorWithRed:235/255.0 green:116/255.0 blue:35/255.0 alpha:1.0]];
return YES;
} else {
return NO;
}
}
I have used above code in 2-3 apps and Apple has approved.
Just while updating app, mention in notes that you are using above code (paste the code in notes, which is very important. Let apple know the code we are using). As we show the code to apple, they know that though we are accessing private api, we are not harming anything. So based on my request, they approved 2 apps on the app store. Apps are BaitBite, Lovely Collectibles & Q8Rent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With