繁体   English   中英

您如何在没有标签栏的主页上,然后在其中一个页面上添加标签栏?

[英]How do you have a main page with out a tab bar and then on one of the pages add a tab bar?

我的程序的主页是菜单。 用户选择其中一个按钮后,它会进入选项卡栏。 我不知道该怎么做,我发现的所有内容都是让整个程序成为标签栏。

你可以简单地做

UITabBarController *tabBarController = [[UITabBarController alloc] init];

UIViewController *controller1 = [[UIViewController alloc] initWithNibName:@"View1" bundle:nil];
controller1.title = @"View1";

UIViewController *controller2 = [[UIViewController alloc] initWithNibName:@"View2" bundle:nil];
controller1.title = @"View2";

tabBarController.viewControllers = [NSArray arrayWithObjects:controller1,controller2,nil];

[self.navigationController pushViewController:tabBarController];

[controller1 release];
[controller2 release];
[tabBarController release];

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM