Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

UITabBarController not picking Title of Rootview in NavigationController #127

Open
wolfposd opened this issue Nov 15, 2013 · 0 comments
Open
Labels

Comments

@wolfposd
Copy link

Setup:

tabBarController = [[UITabBarController alloc] init];
Controller1* c1 = [Controller1 new];
Controller2* c2 = [Controller2 new];
UINavigationController* navCon = [[UINavigationController alloc] initWithRootViewController:c1];

[tabBarController addChildViewController: navCon];
[tabBarController addChildViewController: c2];

you will see that the first tab wont have the title of c1, but the second tab will have title of c2

Workaround:

navCon.title = c1.title;

Possible fix:

in UI7NavigationController.m # 90:

- (id)initWithRootViewController:(UIViewController *)rootViewController {
    self = [self initWithNavigationBarClass:[UI7NavigationBar class] toolbarClass:[UI7Toolbar class]];
    if (self != nil) {
        self.viewControllers = @[rootViewController];
        self.title = rootViewController.title; // ADD THIS LINE
        [self _navigationControllerInit];
    }
    return self;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant