TabBarController *tabBar = [[TabBarController alloc] init];
tabBar.viewControllers = vcNames; //vcNames是五个视图控制器的数组
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:tabBar];
[nc.navigationBar setBackgroundImage:[UIImage imageNamed:@"navigationbar.png"] forBarMetrics:UIBarMetricsDefault];
nc.navigationBar.backgroundColor = [UIColor redColor];
self.window.rootViewController = nc;
[nc release];
[tabBar release];
通常不应该是五个导航控制器共用一个tabBarController吗?
你可以建立一个rootController 让五个视图都继承就可以了啊
怎么会有这样的需求?为什么要这么做。。通常是一个tabbarController的一个item对应一个导航的你可以试一试这个
继承自同一个父类是个比较不错的方法。