Skip to content

Instantly share code, notes, and snippets.

@jeksys
Created June 15, 2012 13:15
Show Gist options
  • Save jeksys/2936420 to your computer and use it in GitHub Desktop.
Save jeksys/2936420 to your computer and use it in GitHub Desktop.
custom UINavigationBar
UIImage *backgroundImage = [UIImage imageNamed:@"UI_navbar.png"];
[[UINavigationBar appearance] setBackgroundImage:backgroundImage
forBarMetrics:UIBarMetricsDefault];
UIImage *backButton = [[UIImage imageNamed:@"UI_backbutton.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0,0,0,0)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButton forState:UIControlStateHighlighted
barMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor clearColor], UITextAttributeTextColor,
[UIColor clearColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 0)], UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"Verdana-Bold" size:16], UITextAttributeFont,
nil]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment