4

Apple frequently uses a left arrow icon in the their navigation controller "back" button, rather than the word "back" or other text:

enter image description here

It doesn't seem possible to assign an image to this special button with the standard SDK. Am I missing something obvious? If not, what's the most effective way of achieving this? (Can it be done without Photoshopping the whole button in multiple states?)

Thanks.

Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
  • See this discussion as well: http://stackoverflow.com/questions/227078/creating-a-left-arrow-button-like-uinavigationbars-back-style-on-a-uitoolbar – Sophie Alpert Mar 09 '11 at 01:49

2 Answers2

4

Create a UIBarButtonItem with the image and assign it as the backBarButtonItem property of your view controller's navigationItem.

Anomie
  • 92,546
  • 13
  • 126
  • 145
1

You can use -initWithImage:style:target:action: of UIBarButtonItem and put your image instead.

- (id)initWithImage:(UIImage *)image
              style:(UIBarButtonItemStyle)style
             target:(id)target
             action:(SEL)action
Angelo
  • 533
  • 5
  • 18