Try with
self.navigationController.navigationBar.translucent = NO;
In your viewDidLoad
method and let me know :)
If you need this effect on every ViewController, you could simply do:
[[UINavigationBar appearance] setTranslucent:NO]
Or you'll need to do this where you first instantiate the navigation controller. For example, if the navigation controller is the root view controller of your app you can simply do
UINavigationController *nav = (UINavigationController *)self.window.rootViewController;
nav.navigationBar.translucent = NO;
in your
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
If, on the other end, you instantiate it through a segue you could do (in the appropriate view controller)
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([segue.identifier isEqualToString:@"navController"]){
UINavigationController *nav = (UINavigationController *)segue.destinationViewController;
nav.navigationBar.translucent = NO;
}
}
And so on (if you're actually instantiating it from code, it should be the easiest option).