Reputation: 5732
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
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
Reputation: 152
UINavigationBar
in interface builder with default tint color NSLog(@"tint color %@", navBar.tintColor);
you will see the result in log:
tint color UIDeviceRGBColorSpace 0.121653 0.558395 0.837748 1
[navBar setTintColor:[UIColor colorWithRed:0.121653f green:0.558395f blue:0.837748f alpha:1]];
Upvotes: 3
Reputation: 2972
[UIColor colorWithRed:(247/255.0) green:(247/255.0) blue:(247/255.0) alpha:1]
Upvotes: 1
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
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
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