【问题标题】:Storyboard segue hides tabBarButton on destination view故事板 segue 在目标视图上隐藏 tabBarButton
【发布时间】:2012-11-01 17:32:46
【问题描述】:

抱歉英语不好。 我有 MainViewControllerTabBarController 在情节提要中有两个视图。 当我在MainviewController 中按下按钮(使用模态segue)时 - 应用程序根据条件切换到firstTabBarViewsecondTabBarView。它工作正常,但在那之后我在我的任何 tabBarViews 的底部丢失了我的TabBarControls

UPD:按下条形按钮后的操作

-(IBAction)barButtonPressed:(id)sender
{
    if (condition !=0 ) {
        [self performSegueWithIdentifier:@"segue1" sender:nil];
    } else {
        [self performSegueWithIdentifier:@"segue2" sender:nil];
    }
}

【问题讨论】:

  • 向我们展示相关代码总是有帮助的。 ;)

标签: ios storyboard


【解决方案1】:

它按建议工作。模态转场是“全屏转场”,涵盖了您的标准导航堆栈。 如果您只是想更改选定的视图控制器,请使用

[yourTabBarControllerInstance setSelectedIndex:index];

【讨论】:

  • 我的菜鸟无法理解如果我在情节提要中创建“yourTabBarControllerInstance”,我是如何获得它的
  • 我现在用 iPhone 写信,不确定确切的语法。您必须经过:应用程序、委托、主窗口、根视图控制器。应该是 UITabBarController *tb = (UITabBarController *)[[[[UIApplication sharedApplication] delegate] window] rootViewController];
猜你喜欢
  • 2013-04-28
  • 1970-01-01
  • 2014-01-23
  • 1970-01-01
  • 1970-01-01
  • 2012-11-26
  • 2014-09-12
  • 2023-04-06
  • 2015-10-26
相关资源
最近更新 更多