I am making some changes in an old app that is not be worked on for more then 2 years. I've build and run the app in xCode 6 and got the following result.
For the status bar i'm trying the following:
- (void)viewDidLoad
{
[super viewDidLoad];
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
{
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
else
{
// iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
}
// Add this method
- (BOOL)prefersStatusBarHidden {
return YES;
}
Also I'm trying to set View controller-based status bar appearance
to NO
Can anybody help me with this? I'm not using storyboards and not planning to do with this app. It are all seperated XIB files.
Thanks in advance !
EDIT
After adding this code:
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.backgroundColor = [UIColor blackColor];
self.window.clipsToBounds =YES;
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}
I get the following:
My tabbar is created in code in my appdelegate:
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:homeNavigation,bookNavigation,doctorsNavigation,settingsNavigation,locatorNavigation,nil];
[self.window makeKeyAndVisible];