简体   繁体   English

启动iPhone应用程序时如何显示第二或第三标签栏

[英]how to show up 2nd or third tab bar when iphone app is launched

hi I've created an iphone app. 嗨,我已经创建了一个iPhone应用程序。 I am using 5 tab bar items. 我正在使用5个标签栏项。 By default, when app gets launched, it shows up first tabbar. 默认情况下,启动应用程序时,它会显示第一个标签栏。 What i want to do is to display 3rd tab bar when application is launched. 我想做的是在启动应用程序时显示第3个选项卡栏。 How can i do that? 我怎样才能做到这一点?

Best regards, Abdul qavi 最好的问候,阿卜杜勒·卡维

In the application didFinishLaunchingWithOptions method of your AppDelegate, some time before the end, add the indicated line. application didFinishLaunchingWithOptionsapplication didFinishLaunchingWithOptions方法中,在结束之前的某个时间,添加指示的行。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    . . . 

    // Add this line
    tabcontroller.selectedIndex = 2;

    [window addSubview:tabcontroller.view];
    [window makeKeyAndVisible];
    return YES;
}

Note that the 2 is the tab to switch to, starting with 0 for the first tab. 请注意,2是要切换到的标签,第一个标签从0开始。

just set the selectedItem property of the tabbar to the number you want to show up. 只需将标签栏的selectedItem属性设置为要显示的数字即可。

hAPPY iCODING.... 快乐编码...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将第二视图添加为标签栏视图(iPhone SDK) - How to add a 2nd view as a Tab Bar View (iPhone SDK) 以编程方式加载ViewController时,iPhone应用程序在第二次启动时崩溃 - iPhone app crashes at 2nd startup, when programmatically loading a ViewController 如何在基于导航的iPhone应用程序中启动时跳至第二级viewController - How to jump to 2nd level viewController on startup in navigation based iPhone app 如何在 iPhone 应用程序中单击选项卡时隐藏选项卡栏 - How to hide the tab bar on click of a tab in an iPhone app 自定义iPhone应用程序选项卡栏 - Custom iPhone App Tab Bar iPhone,UITabBarItem:在应用启动时动态更改标签栏的图像 - iPhone, UITabBarItem: Dynamically change image of a tab bar when app starts 使用标签栏在视图之间切换时,iPhone应用程序崩溃 - Iphone app crashes when switching between views using tab bar 在iPhone应用程序中启动应用程序时如何检索输入的选项卡栏视图控制器中输入的用户输入数据 - How to retrieve user input data entered tab bar View Controller when application start in iphone app iPhone:如何隐藏标签栏以显示全屏视图 - iPhone: How to hide tab bar to show fullscreen view 我的应用程序在我的Iphone上启动时崩溃了 - My App crashes when launched on my Iphone
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM