UITabBarController *tabBarCtr = [[UITabBarController alloc]init];
SecondViewController *secondViewCtrl1=[[SecondViewController alloc]init];
UINavigationController *navCtrl1=[[UINavigationController alloc]initWithRootViewController:secondViewCtrl1];
[secondViewCtrl1 release];
TabBarViewController *secondViewCtrl2=[[TabBarViewController alloc]init];
UINavigationController *navCtrl2=[[UINavigationController alloc]initWithRootViewController:secondViewCtrl2];
[secondViewCtrl2 release];
NSArray *array=[NSArray arrayWithObjects:navCtrl1,navCtrl2,nil];
tabBarCtr.viewControllers=array;
[self presentModalViewController:tabBarCtr animated:YES];
本文介绍了一个使用 UITabBarController 的示例。示例中创建了两个 UINavigationController 实例,并将它们设置为 UITabBarController 的 viewControllers 属性,实现了带有标签栏的导航界面。
1121

被折叠的 条评论
为什么被折叠?



