Yes, I have seen many questions about this, but nothing that deals with my specific problem.
I have managed to get the status bar to be a solid black (I'd like blue but I am happy that it is solid an not transparent). I accomplished this by doing
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
[application setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.clipsToBounds =YES;
}viewDidLoad doing if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}Great.

But behind a UITabBarController it is still transparent. The view controllers inside my tabbarcontroller are subclasses of a the same view controller in the first screen shot. And the same viewDidLoad code is being called.
Any ideas?

After several days of messing around I have a solution:
1) set View controller-based status bar appearance to NO in the MyApp-info.plist (add the key if you need it)
2) Put this in the master and detail view controllers viewDidLoad:
self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
self.navigationController.navigationBar.translucent = NO;
self.navigationController.navigationBar.barTintColor = [your background colour];
self.navigationController.navigationBar.tintColor = [color of the text of buttons];
3) This will make the top bar opaque, so, in the storyboard, if you have a uitabbarcontroller you need to set the under opaque bars setting on it.
As a bonus tip:
To make the navigation bar match it I do the following in the AppDelegate didFinishLaunchingWithOptions:
[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc]init] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundColor:[same color as barTintColor above]];
[[UINavigationBar appearance] setTitleTextAttributes:@{UITextAttributeTextColor:[UIColor whiteColor]}];
I hope this helps someone!
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