On iOS 7, is there any way to change the back button arrow's vertical alignment? I can only change the vertical alignment of the title and nothing in UIBarButtonItem's appearance suggest that the arrow vertical alignment can be changed.
See the following example:
I think the best way to reach your goal is setting the UINavigationBar
s backIndicatorImage
to an arrow-image with space around it. You can mask your image, so the text is able to flow into parts of the image.
UINavigationBar *navigationBar = ...;
navigationBar.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Activity" style:UIBarButtonItemStylePlain target:nil action:nil];
navigationBar.backIndicatorImage = [UIImage imageNamed:@"arrow-image"];
navigationBar.backIndicatorTransitionMaskImage = [UIImage imageNamed:@"arrow-image-mask"];
AppCoda wrote a great article about customizing the UINavigationBar
in iOS7. It's worth reading:
http://www.appcoda.com/customize-navigation-status-bar-ios-7/
As the docs say you have to set BOTH properties to get this up and running: https://developer.apple.com/library/ios/documentation/uikit/reference/uinavigationbar_class/Reference/UINavigationBar.html#//apple_ref/occ/instp/UINavigationBar/backIndicatorImage
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With