开发者

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

hi I've created an iphone app. I am using 5 tab bar i开发者_开发问答tems. 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. 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.

- (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.


just set the selectedItem property of the tabbar to the number you want to show up.

hAPPY iCODING....

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜