5

I set a special color for my Nav Bar in the AppDelegate:

[[UINavigationBar appearance]setBarTintColor:[UIColor colorWithRed:0 green:(41.0f/255.0f) blue:(103.0f/255.0f) alpha:1]];

But the RGB Value which is then displayed is: R:12 G:48 B:110. It seems that iOS just puts the values a bit higher. How can I avoid that? (Because it looks ugly) And when I give the same color an customized TableViewSection it is right.

Screenshots:

NavBar: Navigation Bar

Customized TableViewSection: enter image description here

gallileo
  • 462
  • 5
  • 21

3 Answers3

7

Ok they were translucent. Unchecked translucent in StoryBoard, works fine now;)

gallileo
  • 462
  • 5
  • 21
  • 1
    If you're not using a storyboard, you can also set this programmatically using the `translucent` property of `UINavigationBar`. – Evan R Mar 28 '15 at 02:18
1

Try adding this to your AppDelegate:

[[UINavigationBar appearance] setTranslucent:NO];
vakio
  • 3,134
  • 1
  • 22
  • 46
0

I had a similar problem...i tried to replace expression in brackets (41.0f/255.0f) by value after divison (~0.1608)...and it works to me)

Konstantin
  • 156
  • 1
  • 9