Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove translucent bar in navigation bar created with storyboard

I created a navigationController from the storyboard and now i'm trying to remove it's translucent option

I've 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 crashing my app with a nonsense error, so I'm not sure if this is the right approach.

I have found this similar question but didn't solved my problem: Navigation Controller Transparent Bar Style is not working

But I'm not sure how to do that because I don't have a variable navController since I created my navigationController from the storyboard. How can I call the storyboard navigation controller programmatically and do something like that?

Thanks

like image 779
Rodrigo Parra Avatar asked Jun 16 '13 04:06

Rodrigo Parra


1 Answers

Add this to viewDidLoad on the first view controller appearing on the navigation stack:

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
like image 125
blake305 Avatar answered Oct 20 '22 23:10

blake305