Search code examples
buttonnavigationtitletabbar

UITabBarController/UINavigationController missing title


I have a UINavigationController and UITabBarController visible at the same time. Both the tab bar buttons and the navigation bar take their text from the title of the currently active view.

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"View Title";

However I want the different. In fact I'd like the navigation controller title to remain the same whichever view is being displayed.

Any ideas?

Many thanks.


Solution

  • You'll have to manually assign the title name, as you are doing above, in your other view controllers.

    If your view hierarchy is more than two levels deep, be wary as the back button will look a little strange to the user (unless you override it). In fact, if every view has the same title, that may look strange to the user, period...