In a navigation controller, you automatically get the correct colour and position of a navigation bar as expected.
like this
After a few tries to move Navigation Bar few pixels down in iOS 7, this is what finally worked for me:
-(void)viewWillLayoutSubviews
{
float iosVersion = 7.0;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= iosVersion) {
// iOS 7+
CGRect viewFrame = self.view.frame;
viewFrame.origin.y += 10;
self.view.frame = viewFrame;
}
}
I also adjusted the Status Bar color to better match my content:
-(UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}