0

Is it possible to change the text of a Back button after its already been rendered?

I've found how to customize the text before the view is loaded:

How to change text on a back button

but these techniques don't seem to work once the view presenting the Back button has already been loaded, which is a requirement of my project.

Thanks!

Community
  • 1
  • 1
oshea
  • 186
  • 1
  • 6
  • 1
    I'm not sure why you want to do this, the point of a navigation controller is to display a consistant interface for returning to the previous view; the way iOS does this is by setting the text of the back button to the name of the previous view. – Alan Zeino Feb 15 '11 at 01:38
  • just create a new button and set it to be the new back button? – ThomasRS Feb 15 '11 at 03:14

1 Answers1

0

One thing you have to remember. i.e., the back button title is based on the previous view navigationController's title

that means if the previous viewController's navigation title is @"XYZ" then in the present viewController the backbutton's title is "XYZ" only.

And if there is no title in the previous controller then for default it will show "Back" as title for backButton.

Based on that you can manipulate the things.

Or else you can add the new barbutton to the leftBarButton as specified in the link given by you.

Regards,

Satya.

Satya
  • 3,320
  • 1
  • 20
  • 19
  • Trying to add a new barbutton as the leftBarButton after the view was already rendered did not work for me. – oshea Feb 15 '11 at 17:00
  • use as following navigationItem.leftBarButton = nil; and then set new button; it will work – Satya Feb 15 '11 at 19:37