문제

hi I've created an iphone app. I am using 5 tab bar items. 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....

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top