Skip to content

TabbarController跳转 #296

@BigPoro

Description

@BigPoro

根视图初始化:
tabController.viewControllers = @[[[RTRootNavigationController alloc] initWithRootViewController:[story instantiateViewControllerWithIdentifier:@"Root"]],
[[RTRootNavigationController alloc] initWithRootViewController:[story instantiateViewControllerWithIdentifier:@"Remove"]],
[[RTRootNavigationController alloc] initWithRootViewController:[story instantiateViewControllerWithIdentifier:@"Scroll"]],
[[RTRootNavigationController alloc] initWithRootViewController:[story instantiateViewControllerWithIdentifier:@"Table"]]];
self.window.rootViewController = tabController;

在某个二级控制器内。跳转第二层TabbarController:
UITabBarController *tabController = [[RTTabBarController alloc] init];

tabController.viewControllers = @[[[RTRootNavigationController alloc] initWithRootViewController:[story instantiateViewControllerWithIdentifier:@"Root"]],
                                  [[RTRootNavigationController alloc] initWithRootViewController:[story instantiateViewControllerWithIdentifier:@"Remove"]],
                                  [[RTRootNavigationController alloc] initWithRootViewController:[story instantiateViewControllerWithIdentifier:@"Scroll"]],
                                  [[RTRootNavigationController alloc] initWithRootViewController:[story instantiateViewControllerWithIdentifier:@"Table"]]];
[self.rt_navigationController pushViewController:tabController animated:YES complete:^(BOOL finished) {
    [tabController.navigationController setNavigationBarHidden:YES animated:YES];
}];

然后再第二层的TabbarController的某个二级控制器手势返回,会直接回到第一个TabbarController,而不是第二个TabbarController的一级控制器。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions