navigationBar color disappear - iOS

218 views Asked by At

I set the color to be red on my navigation bar but becouse i have steak of controllers when i go back from one controler to other, the red color disappear and it becomes transparent. Any idea why ?

[[UINavigationBar appearance]setBarTintColor:[UIColor colorWithRed:255.0/255 green:92.0/255 blue:88.0/255 alpha:1]];
3

There are 3 answers

0
manish_kumar On

Go to AppDelegate of your project and in function

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)

paste your code for changing the tint colour of navigation bar. It will work there.

0
Bharat Nakum On

Maybe you are updating navigation bar color in another view controller.

Try setting navigation bar color in the viewWillAppear or viewDidAppear method.

Hope this helps.

0
FICOOO On

I found the problem, i was setting white color on the main navigation bar