0

I am trying to set my navigation bar and status bar to "color5"

UIColor* color5 = [UIColor colorWithRed: 0.114 green: 0.705 blue: 1 alpha: 1];

I made my navigation bar a property and tried to set the tint color:

navBar.tintColor = color5;

but this didn't work. I also tried doing it in the AppDelegate:

[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0x067AB5)];

this worked but didn't set the navigation bar to the color I wanted and only set the navigation bar, not the status bar. I am trying to figure out my hex number for my UIColor but I can't figure it out. I think the problem is that is has decimals but it works fine setting the buttons I am using. Thanks a lot for any help.

Irfan
  • 4,301
  • 6
  • 29
  • 46

1 Answers1

0

You can use this

if (IOS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
    {
        [[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]];
    } else
    {
        [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
        [[UINavigationBar appearance] setBackgroundColor:[UIColor whiteColor]];
    }
Erhan
  • 908
  • 8
  • 19