I'm trying to replace the default nav bar back button image:
UIImage *backButtonImage = [UIImage imageNamed:@"back_button"] ;
backButtonImage = [backButtonImage resizableImageWithCapInsets:UIEdgeInsetsMake(0, backButtonImage.size.width, 0, 0)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
What I get is this:
What I want is this:
How? The original image is 11x44 points.
EDIT: After applying this,
[UINavigationBar appearance].backIndicatorImage = backButtonImage;
[UINavigationBar appearance].backIndicatorTransitionMaskImage = backButtonImage;
I get this:
I've spent hours trying to get the arrow to move down so that it's vertically aligned with the title text in the navigation bar, to no avail. I've seen other threads with the same problem, but no solution. Why would this be so difficult? It seems like something everyone who replaces the back button image would have to deal this.