nimrod
nimrod

Reputation: 5732

Default UIColor of iPhone Navigation Bar

Can anyone tell me the RGB for the default iPhone navigation bar blue? I know that you can normally set the default color by setting

self.navigationBarTintColor = nil;

However, that doesnt work in this case, so I need to set the exact blue.

Thanks for your answer, Doonot

Upvotes: 11

Views: 12514

Answers (6)

Kiran Bhoraniya
Kiran Bhoraniya

Reputation: 103

// Set Appdelegate.m file
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [self setCustomDesign];
}
-(void)setCustomDesign
{
    [[UINavigationBar appearance] setBarTintColor :UI_DEFAULT_NAV_COLOR] ;
}
//Constant.h
#define UI_DEFAULT_NAV_COLOR [UIColor colorWithRed:5/255.0 green:123/255.0 blue:253/255.0 alpha:1.0f]

Upvotes: 1

jold
jold

Reputation: 152

  1. create separate project, add UINavigationBar in interface builder with default tint color
  2. write this code to get tint color NSLog(@"tint color %@", navBar.tintColor); you will see the result in log: tint color UIDeviceRGBColorSpace 0.121653 0.558395 0.837748 1
  3. set the tint color of any pannel you wish with this values: [navBar setTintColor:[UIColor colorWithRed:0.121653f green:0.558395f blue:0.837748f alpha:1]];

Upvotes: 3

Nataliia.dev
Nataliia.dev

Reputation: 2972

[UIColor colorWithRed:(247/255.0) green:(247/255.0) blue:(247/255.0) alpha:1]

Upvotes: 1

antalkerekes
antalkerekes

Reputation: 2128

[UIColor colorWithHue:0.6 saturation:0.33 brightness:0.69 alpha:0] is a tint very close to the original -- I do see a slight difference though, when compared to the default.

Source: What is the default color for navigation bar buttons on the iPhone?

Upvotes: 8

ipraba
ipraba

Reputation: 16543

I dont know whether this will help you or not. Worth a try.

Open the Digital Color Meter Application in you Mac.

Now Open a view controller in Interface Builder

Place The navigation Bar in the view controller

Move the Mouse to the Navigationbar

Now you can see the RGB value of the pixel that the mouse currently pointing to in the Digital Color meter Application.

use that RGB value in your UIColor

I know its weird. Just a thought.. Just a thought..

Upvotes: 4

klefevre
klefevre

Reputation: 8735

You right : setting tintColor property to nil is the good way to set the default blue color.

But in order to set a tintColor you have to do like that :

self.navigationController.navigationBar.tintColor = nil;

Upvotes: 12

Related Questions