【问题标题】:[Storyboard TabController Error][Storyboard TabController Error]
【发布时间】:2012-10-27 22:53:39
【问题描述】:

我的 tabbarcontroller 有问题。我正在使用情节提要,我在 tabbarcontroller 和 viewcontroller 之间使用导航控制器。而且我有登录页面..从登录页面,我想直接进入 viewcontroller 2.tabbarcontroller..但是当我这样做时,我看不到标签栏控制器..可能是什么问题?你有什么建议?

  self.tabBarController = [[UITabBarController alloc] init];
    UIImage* tabBarBackground = [UIImage imageNamed:@"Tab_bar_bkg.png"];
    [[UITabBar appearance] setBackgroundImage:tabBarBackground];

    [[UITabBarItem appearance] setTitleTextAttributes:
     [NSDictionary dictionaryWithObjectsAndKeys:
      [UIColor whiteColor], UITextAttributeTextColor,
      [NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset,
      [UIFont fontWithName:@"Helvetica" size:0.0], UITextAttributeFont,
      nil] forState:UIControlStateNormal];

提前谢谢你..

【问题讨论】:

  • 登录页面的 segue 应该转到 Storyboard 中的标签栏控制器。你是这样设置的吗?您在登录屏幕和下一个屏幕之间使用哪种类型的 segue(模态、推送、其他?)?
  • 我也试过这个..我的意思是用push segue去tabbar..但是没用?对于登录屏幕,我没有使用和 segue...我刚刚用代码调用。但是我的问题我不知道这样一个问题,当我登录时我可以看到标签栏..但是当我在没有登录的情况下调用我想要的页面时,我看不到我的标签栏控制器???
  • 推送转场只能与导航控制器一起使用。是导航控制器中的登录屏幕。如果没有,请使用模态转场。
  • 我已经在导航控制器中使用了登录与推送segue ..而且我尝试通过模式segue 登录(没有导航控制器)来做到这一点..但我没有工作? :/ 我的 tabbarcontroller 连接到导航控制器中的 viewcontroller..我不知道这可以帮助我吗?

标签: ios storyboard tabbarcontroller


【解决方案1】:

最后我找到了解决方案。问题是没有使用这个:

 [self dismissModalViewControllerAnimated:YES];

我用过那个:

[self presentModalViewController:controller animated:YES]

非常感谢您的帮助...

【讨论】:

    猜你喜欢
    • 2013-05-27
    • 2020-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-07
    • 1970-01-01
    • 1970-01-01
    • 2022-08-24
    相关资源
    最近更新 更多