UI7Kit icon indicating copy to clipboard operation
UI7Kit copied to clipboard

UITabBarController not picking Title of Rootview in NavigationController

Open wolfposd opened this issue 12 years ago • 0 comments

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;
}

wolfposd avatar Nov 15 '13 13:11 wolfposd