Skip to content

Instantly share code, notes, and snippets.

@mteece
Created December 11, 2012 20:46
Show Gist options
  • Select an option

  • Save mteece/4261986 to your computer and use it in GitHub Desktop.

Select an option

Save mteece/4261986 to your computer and use it in GitHub Desktop.
Set the default UINavigationBar background image (and baseColor) app wide. Needs the @2x as well.
// For .h file - (void) customizeAppearance; and @property (nonatomic, retain) UIColor *baseColor;
// For .m file.
- (void) customizeAppearance
{
_baseColor = [[UIColor alloc] initWithCIColor:[CIColor colorWithRed:0.157
green:0.169
blue:0.235
alpha:1.0]];
#warning Use the code below to set the global background color in IOS5+
//[[UIView appearance] setBackgroundColor:_baseColor];
UIImage *tileImage = [UIImage imageNamed:@"inner-header-large.png"];
[[UINavigationBar appearance] setBackgroundImage:tileImage forBarMetrics:UIBarMetricsDefault];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment