Delete translucent panel in the navigation bar created using the storyboard

I created a navigation controller from the storyboard, and now I'm trying to remove its translucent option

I put this on my appdelegate.m

[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:52.0/255 green:152.0/255 blue:219.0/255 alpha:1]]; [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; [[UINavigationBar appearance] setTranslucent:NO]; 

But this is a failure of my application with an error, but I'm not sure if this is the right approach.

I found this similar question, but did not solve my problem: The Transparent Bar Style navigation controller does not work

But I'm not sure how to do this because I do not have the navController variable since I created my navigation controller from the storyboard. How can I programmatically call the navigation manager for the storyboard and do something similar?

thanks

+7
ios objective-c iphone
source share
3 answers

Add this to viewDidLoad on the first view controller that appears in the navigation stack:

 self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 
+6
source share

If you designed your presentation using storyboards, you can solve the problem with Xcode. Select the NavigationBar widget and uncheck the Transparent box.

Xcode 5

+9
source share

If you are not using a storyboard but IB, set the style of the navigation bar to MainWindow.xib to NOT translucent and set the color to not transparent.

0
source share

All Articles