Reputation: 11597
So im writing an app that needs to support ios 6 and 7, app looks good in iOS 7 but on iOS 6 for some reason the navigation bar sits underneath the status bar and i have no idea why. it happens on all of my screens
i've tried settings the status bar to opaque but everything i have tried still leaves it as translucent, i thought maybe having it opaque would make it move down (i would prefer to keep it translucent though)
running Xcode 5.1.1
i have my own navigation controller implemented, but all it does is set self.navigationBar.tintColor = THEME_COLOUR;
(and some other things when in iOS 7 but that doesnt execute here)
in the storyboard i have unticked 'under top bars' and ive messed around with the UINavigation bar appearance property and nothing seems to affect it
Upvotes: 3
Views: 358
Reputation: 11597
So im not sure why, but i fixed the problem by manually moving the navigation bar down in my root view controller like so:
if( ! IS_OS_7_OR_LATER){
CGRect navFrame = self.navigationController.navigationBar.frame;
navFrame.origin.y += 20;
self.navigationController.navigationBar.frame = navFrame;
}
it seems to be something to do with my login view having a hidden nav bar, then my root view unhiding the nav bar, but im not sure exactly what. but luckily i only needed that code in the root view and it seemed to affect all subsequent views (probably because the status bar and nav bar are inferred in the storyboard)
Upvotes: 1