Custom back button in navigation

The navigation back button is customized using the UIBarButtonItem appearance. The back button image, font and text color are set.

The title position can be adjusted if needed.

The line below (e.g. set in the constructor) is used to set the custom back button with a title. The previously set appearance will be used.

The important thing is that the button is set on a controller the navigation will pop to. For example, in situation with root and details controllers, where the root controller pushes the details controller, the line above is set in the root controller, not the details.

Related Post

Remember to share...Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someone

One thought on “Custom back button in navigation

  1. Hi, thanks for this. A question, why do you use this line?

    [[UIImage imageNamed:@”btnBack”] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 7)];

    What do you need the edge insets for? Having applied your code with all 0 but the left inset to 10, I get a back image with the right side “bitten” off.

Leave a Reply

Your email address will not be published. Required fields are marked *