[英]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 didFinishLaunchingWithOptions
的application 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.