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....
精彩评论