Best way to get a โ€œbackโ€ navigation button with an arrow in it?

Apple often uses the left arrow icon in its back button on the navigation controller, rather than in the back word or other text:

enter image description here

It is not possible to assign an image to this special button with a standard SDK. Am I missing something? If not, what is the most effective way to achieve this? (Can this be done without Photoshopping the entire button in several states?)

Thanks.

+4
source share
2 answers

Create a UIBarButtonItem with an image and assign it as the backBarButtonItem property of your view view control.

+4
source

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

 - (id)initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action 
+1
source

Source: https://habr.com/ru/post/1342925/


All Articles