0

iOS 7 Retina Display Cuts top portion of Navigation Bar after simply viewing a YouTube video or go to a URL that streams music. The Navigation Bar remains cut of at the top through out the app. Almost looks like a thin black bar or a gap that cuts a small portion at the top and the best way I can explain it is if you see a navigation bar at the top of a an app, imagine that the top half of it is black.

Little info about Status bar in the app: Status bar is initially hidden YES View controller-based status bar appearance NO Using Auto Layout

I would appreciate any help as this is really frustrating.

AsL
  • 105
  • 1
  • 9
  • 1
    Does this help? http://stackoverflow.com/questions/18775874/ios-7-status-bar-overlaps-the-view – erdekhayser Jan 04 '14 at 20:30
  • WOW! SIR I THANK YOU! Thank You so very much!!! There was an answer in that thread that I had not tried and it worked! Thank You! – AsL Jan 04 '14 at 20:39

1 Answers1

2

This solved the issue:

-(void)viewWillLayoutSubviews {
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
        self.view.clipsToBounds = YES;
        CGRect screenRect = [[UIScreen mainScreen] bounds];
        CGFloat screenHeight = screenRect.size.height;
        self.view.frame =  CGRectMake(0, 20, self.view.frame.size.width,screenHeight-20);
        self.view.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    }
}
Steph Sharp
  • 11,462
  • 5
  • 44
  • 81
AsL
  • 105
  • 1
  • 9