问题
I had Take ViewController And Put Navigation Controller from Object Library than Put Tab Bar Same As Navigation Controller.... But Tab Bar Can't Show In Controller...
回答1:
First declare your tab bar controller in your delegate .h file
@property (strong, nonatomic) UITabBarController *tabBarController;
then declare your root view controller and add it to navigation controller in .m file
UIViewController *homeViewController = [[[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil] autorelease];
UINavigationController *navigationcontroller = [[[UINavigationController alloc] initWithRootViewController:homeViewController] autorelease];
then add the array of controllers to tab bar
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationcontroller,secondViewController and so on, nil];
来源:https://stackoverflow.com/questions/10229805/i-want-to-use-both-tab-bar-and-navigation-bar-in-same-view-controller