Mayank Purwar Mayank Purwar - 1 month ago 7x
iOS Question

Change navigation bar tint color iOS 7.

I know how to change navigation bat tint colour in iOS 6:

[UINavigationBar appearance].tintColor = [UIColor colorWithRed:129/255.0 green:200/255.0 blue:244/255.0 alpha:1.0];

I'm adding this code in APPDelegate page.
Now I want to do this in iOS 7 but above code is not working.
I searched on net. I got a solution. By adding below function to every page I can change navigation color.

self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:129/255.0 green:200/255.0 blue:244/255.0 alpha:1.0];

But I need a function which can add to APPDelegate function.
Please help me to overcome this issue.


you can add bellow code in appdelegate.m

  if your app is navigation based

 // for background color
  [nav.navigationBar setBarTintColor:[UIColor blueColor]];

 // for change navigation title and button color
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary    dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName,  [UIFont fontWithName:@"FontNAme" size:20], NSFontAttributeName, nil]];

[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];