Skip to content

Instantly share code, notes, and snippets.

@MugunthKumar
Created February 27, 2013 02:41
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 MugunthKumar/5044533 to your computer and use it in GitHub Desktop.
Save MugunthKumar/5044533 to your computer and use it in GitHub Desktop.
UIAppearance for nav bar customization.
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil]
setBackgroundImage:[[UIImage imageNamed:@"NavButton"] stretchableImageWithLeftCapWidth:10 topCapHeight:0]
forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil]
setBackButtonBackgroundImage:[[UIImage imageNamed:@"BackButton"] stretchableImageWithLeftCapWidth:15 topCapHeight:0]
forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTintColor:[UIColor rmRedColor]];
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"NavBarBG"]
forBarMetrics:UIBarMetricsDefault];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
[[UINavigationBar appearance] setTitleTextAttributes:@{
UITextAttributeFont:[UIFont fontWithName:@"Aller-Bold" size:20],
UITextAttributeTextColor:[UIColor whiteColor],
UITextAttributeTextShadowColor:[UIColor colorWithWhite:0.0 alpha:0.5],
UITextAttributeTextShadowOffset:[NSValue valueWithCGSize:CGSizeMake(0.0f, 1.0f)]
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment