Skip to content

Instantly share code, notes, and snippets.

@hunk
Created January 19, 2012 02:14
Show Gist options
  • Save hunk/1637194 to your computer and use it in GitHub Desktop.
Save hunk/1637194 to your computer and use it in GitHub Desktop.
background NavigationBar
UIImage *gradientImage44 = [[UIImage imageNamed:@"nav44"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
UIImage *gradientImage32 = [[UIImage imageNamed:@"nav32"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UINavigationBar appearance] setBackgroundImage:gradientImage44
forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:gradientImage32
forBarMetrics:UIBarMetricsLandscapePhone];
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:175.0/255.0 green:175.0/255.0 blue:175.0/255.0 alpha:1.0],
UITextAttributeTextColor,
[UIColor colorWithRed:255.0 green:255.0 blue:255.0 alpha:0.8],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"Arial-Bold" size:0.0],
UITextAttributeFont,
nil]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment