【问题标题】:UINavigationController poptorootviewcontroller and select another tab makes transition like push a view controllerUINavigationController poptorootviewcontroller 并选择另一个选项卡进行转换,如推送视图控制器
【发布时间】:2016-05-07 06:07:47
【问题描述】:

我有一个标签栏控制器,每个标签都有一个UINavigationController。它看起来像这样:

[tab1:UINavigationController,  tab2:UINavigationController, tab3:UINavigationController]

tab1 有一个视图控制器,允许用户发布内容。像这样的:

tab1:rootviewcontroller -> SelectLocationViewController -> CreatePostViewController

标签 3 是 viewController 显示用户发布的任何内容,就像这样

tab3:navigationController(rootViewController:PostHistoryViewController)

我想要做的是,当用户完成发布某些内容时,它将导航回选项卡栏控制器并选择选项卡 3。但我希望整个过渡看起来像推动视图控制器。怎么做?

【问题讨论】:

    标签: ios uinavigationcontroller uitabbarcontroller


    【解决方案1】:

    使用 StoryBoardID

    ViewControllerName *push=[self.storyboard instantiateViewControllerWithIdentifier:@"ViewControllerName"];
    
    [self.navigationController pushViewController:push animated:YES];
    

    【讨论】:

    • 请仔细阅读我的问题,有三个标签,因此有三个UINavigationController。所以我目前的实现是从tab1的UINavigationControllerpoptoviewcontroller再做tabBarController.selectedIndex = 2,但是这种过渡体验很糟糕。我想要这个过程就像“推视图控制器”
    猜你喜欢
    • 1970-01-01
    • 2015-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-30
    • 1970-01-01
    相关资源
    最近更新 更多