【问题标题】:Tab bar & Storyboard : Change the default tab标签栏和情节提要:更改默认标签
【发布时间】:2012-08-03 14:11:09
【问题描述】:

我的故事板中有一个标签栏和 5 个标签。

我希望我的应用加载到中间选项卡上,但我不知道如何做以及在哪里做。

【问题讨论】:

  • 您应该将其添加为您自己问题的答案并接受它(您可能需要等待一段时间才能让您这样做)。搞清楚了,干得好!

标签: iphone xcode storyboard tabbar


【解决方案1】:

我找到了答案!

在 appDelegate.m 中:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UITabBarController *tabBar = (UITabBarController *)self.window.rootViewController;
tabBar.selectedIndex = 2;
return YES;
}

希望对您有所帮助!

【讨论】:

  • 当我在第二个标签栏并需要转到第三个标签栏时,如果我需要在按钮单击上执行相同操作,代码应该是什么?
猜你喜欢
  • 2014-05-05
  • 1970-01-01
  • 1970-01-01
  • 2013-07-29
  • 2016-02-20
  • 2015-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多