Skip to content

Instantly share code, notes, and snippets.

@kmdarshan
Created March 9, 2015 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmdarshan/c88839843b6aa5176d1e to your computer and use it in GitHub Desktop.
Save kmdarshan/c88839843b6aa5176d1e to your computer and use it in GitHub Desktop.
// change the color of the navigation bar
[[UINavigationBar appearanceWhenContainedIn:[UINavigationController class], nil] setBarTintColor:[RRHelper appBlue]];
// change the tint color of the navigation bar
[[UINavigationBar appearanceWhenContainedIn:[UINavigationController class], nil] setTintColor:[UIColor whiteColor]];
// change the title text attributes
[[UINavigationBar appearanceWhenContainedIn:[UINavigationController class], nil] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, [UIFont fontWithName:kFontRegular size:18.0], NSFontAttributeName, @0.5, NSKernAttributeName, nil]];
// change the bar button item properties
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTintColor:[UIColor whiteColor]];
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes: @{
NSForegroundColorAttributeName:[UIColor whiteColor],
NSFontAttributeName:[UIFont fontWithName:kFontRegular size:kFontSizeNavigationBarSmall],
NSKernAttributeName:@0.5
} forState:UIControlStateNormal];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment