Home Tutorial Iphone Examples Change Button Text iPhone

 
 

Share on Google+Share on Google+
Change Button Text iPhone
Posted on: April 21, 2010 at 12:00 AM
Advertisement
In a UINavigationController based application, most of the time you can find that the back button on TopView shows the same title as the previous view has. And it looks quite odd when the title is too long. But luckily we can change the button text in iPhone app.

Change Button Text iPhone

In a UINavigationController based application, most of the time you can find that the back button on TopView shows the same title as the previous view has. And it looks quite odd when the title is too long. But luckily we can change the button text in iPhone app.

Find the given code that will change the text on the back button. You can also give it a Title of your choices instead of Back. We are calling it "Home" in our UINavigationController application.

Code:

self.navigationItem.backBarButtonItem =[[UIBarButtonItem alloc] initWithTitle:@"HOME"
style: UIBarButtonItemStyleBordered
target:nil
action:nil];

Just copy this code into your ViewDidLoad method and build the application. It must have the same output as given in the Image.


Download Code

Advertisement

Related Tags for Change Button Text iPhone:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 21, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com