0

Hi status bar overlapping with navigation bar.though i am able to display correctly when i load screen when i rotate navigation bar and status bar overlaps i tried to set all these properties

if([[[UIDevice currentDevice] systemVersion]floatValue ] >= 7.0)
{
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.automaticallyAdjustsScrollViewInsets = NO;

        self.navigationController.navigationBar.translucent=NO;
        self.edgesForExtendedLayout = UIRectEdgeAll;
}
Cœur
  • 34,719
  • 24
  • 185
  • 251
iOSdev
  • 553
  • 5
  • 22

1 Answers1

0
If you're not using storyboard, then you can use this code in your AppDelegate.m in did finishlaunching:

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
[application setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.clipsToBounds =YES;
self.window.frame =  CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}
Alok Chandra
  • 1,867
  • 1
  • 20
  • 45
  • why cannot we play with autolayout constraints to fix this.there are so many properties iOS7 is suggesting why do u struggle in finding the frame and setting the frame.it will be harmful if you play with frame when you are working with autolayout or autoresizing. – iOSdev Apr 07 '14 at 11:42
  • okz plz update ur answer here if u able to do it with constraints – Alok Chandra Apr 07 '14 at 12:01