Skip to content

Instantly share code, notes, and snippets.

@psobko
Created November 4, 2013 16:46
Show Gist options
  • Save psobko/7305480 to your computer and use it in GitHub Desktop.
Save psobko/7305480 to your computer and use it in GitHub Desktop.
[[UINavigationBar appearance] setTintColor:[UIColor grayColor]];
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault]; // Takes out title
UIImage *backButtonImage = [UIImage imageNamed:@"BackArrowDark.png"];
if ([UINavigationBar instancesRespondToSelector:@selector(setBackIndicatorImage:)]) {
[[UINavigationBar appearance] setBackIndicatorImage:backButtonImage];
[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:backButtonImage];
} else {
int imageSize = 21; // REPLACE WITH YOUR IMAGE WIDTH
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[backButtonImage resizableImageWithCapInsets:UIEdgeInsetsMake(0, imageSize, 0, 0)] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment