Peter Lendvay
Peter Lendvay

Reputation: 655

How to change UINavigationBar title without changing UITabBar title?

I have a UINavigationController embed on a UITabBarController. My goal would be to change the title of the UINavigationController's navigation bar while keeping the title on the UITabBarItem too. Tried changing the title of the UIViewController embed on the UINavigationController with:

self.title = @"NavBarTitle";

It does work, but that changes the UITabBarItem's title too. Is there a way to separate those two titles? Thanks!

Upvotes: 1

Views: 597

Answers (1)

Anbu.Karthik
Anbu.Karthik

Reputation: 82759

try this

self.navigationController.visibleViewController.title = @"NavBarTitle";

or use

self.navigationItem.title = @"NavBarTitle";

or try this

self.tabBarController.navigationItem.title = @"NavBarTitle";

Upvotes: 5

Related Questions