在AppDelegate里边实现
//各个标签栏ViewController的实例化 titile为标签栏标题
MainViewController *mainController = [[MainViewControlleralloc] init];
mainController.title = @"大米先生";
OrderViewController *orderController = [[OrderViewControlleralloc] init];
orderController.title = @"发现";
PersonalViewController *personalCntroller = [[PersonalViewControlleralloc] init];
personalCntroller.title = @"我的";
SettheZoneViewController *setthtzoneController = [[SettheZoneViewControlleralloc] init];
setthtzoneController.title = @"订单";
//创建导航栏,并赋给ViewController,设置称为导航栏
UINavigationController *naviga1 = [[UINavigationControlleralloc] initWithRootViewController:mainController];
UINavigationController *naviga2 = [[UINavigationControlleralloc] initWithRootViewController:orderController];
UINavigationController *naviga3 = [[UINavigationControlleralloc] initWithRootViewController:personalCntroller];
UINavigationController *naviga4 = [[UINavigationControlleralloc] initWithRootViewController:setthtzoneController];
//导航栏标题设置
naviga1.tabBarItem = [[UITabBarItemalloc] initWithTitle:@"首页"image:niltag:2];
naviga2.tabBarItem = [[UITabBarItemalloc] initWithTitle:@"发现"image:niltag:3];
naviga3.tabBarItem = [[UITabBarItemalloc] initWithTitle:@"我的"image:niltag:4];
naviga4.tabBarItem = [[UITabBarItemalloc] initWithTitle:@"订单"image:niltag:5];
NSArray *viewArray = [[NSArrayalloc] initWithObjects:naviga1,naviga2,naviga3,naviga4,nil];
//标签栏创建
UITabBarController *tabbarController = [[UITabBarControlleralloc] init];
tabbarController.viewControllers = viewArray;
self.window.rootViewController = tabbarController;
原文:http://www.cnblogs.com/Pegboggs/p/5062451.html