0

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.

enter image description here

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: enter image description here

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];
Steaphann
  • 2,797
  • 6
  • 50
  • 109
  • Have you tried setting status bar setting in .plist file? – Bista Mar 24 '15 at 08:25
  • @the_UB if you mean View controller-based status bar appearance, then YES :) – Steaphann Mar 24 '15 at 08:30
  • Since you have not provide any code about what you did to resolve this issue, check this similar issue [how to fix status bar overlap issue in ios 7](http://stackoverflow.com/questions/25781169/how-to-fix-status-bar-overlap-issue-in-ios-7). – Bista Mar 24 '15 at 08:37
  • Try the solution given in the above link. – Bista Mar 24 '15 at 08:50
  • Now you have to set the status bar color. See [this](http://stackoverflow.com/questions/18897362/changing-the-status-bar-text-color-in-splash-screen-ios-7#). – Bista Mar 24 '15 at 09:01
  • Oh I see ,your tab bar is slightly disappeared. – Bista Mar 24 '15 at 09:07

1 Answers1

0

Try this, if you want to start the view controller below the status bar (write this code in viewDidLoad method).

if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
{
    self.edgesForExtendedLayout=UIRectEdgeNone;
}

and if you want to hide the status bar follow this link

Community
  • 1
  • 1
Saif
  • 2,678
  • 2
  • 22
  • 38