2012年3月6日星期二

iPhone开发 tabBarController与UINavigationController结合

tabBarController = [[UITabBarController alloc] init];

FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *firstNavigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController];
[firstViewController release];

SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *secondNavigationController = [[UINavigationController alloc] initWithRootViewController:secondViewController];
[secondViewController release];

tabBarController.viewControllers = [NSArray arrayWithObjects:firstNavigationController,secondNavigationController,nil];

[(UITabBarItem *)[tabBarController.tabBar.items objectAtIndex:0] setTitle:@"体检数据"];

[window addSubview:tabBarController.view];
[window makeKeyAndVisible];



本文来自:http://www.fanwa.net
iPhone开发 tabBarController与UINavigationController结合

TAG: