Sam
Sam

Reputation: 799

Navigation Controller Title

I have a navigation controller and i set the title in the viewDidLoad like so:

self.title = @"My View Controller";  

But a name like that is too long to fit in the tab bar name down below. How do i change the tab bar name without changing the title displayed on the navigation bar?

Upvotes: 0

Views: 1902

Answers (2)

TommyG
TommyG

Reputation: 4155

You should set the tabBarItem property of the tabBarController of your tab bar. That's the correct way to go.

Upvotes: 0

Dylan Reich
Dylan Reich

Reputation: 1430

If I am correct, you can set them separately. If you are adding view controllers to the tab bar, you can do something like:

thisViewController.title = @"Name of this view controller"; (or self.title in your case)

and then for the title at the top, after have self.navigationItem.title = @"Title at top";?

Upvotes: 2

Related Questions