1. Now when the program is started, 4 Uiviewcontroller are added directly above the Uitabbar. But now the app doesn't add uiviewcontroller directly, but adds Uinavigationcontroller, Add Uiviewcontroller on top of Uinavigationcontroller.
2. Inside the Uitabbarcontroller class, when adding a controller to the "Addchildviewcontroller" method, pass a navigation controller.
Such as:
//set up text and picturesVc.navigationItem.title =@"name"; Vc.tabBarItem.title=@"name"; Vc.tabBarItem.image= [UIImage imagenamed:@"Tabbar_me_icon"]; Vc.tabBarItem.selectedImage= [UIImage imagenamed:@"Tabbar_me_icon"]; //Package A navigation controller, add a Tabbarcontroller controller for the navigation controllerUinavigationcontroller *nav =[[Uinavigationcontroller alloc] INITWITHROOTVIEWCONTROLLER:VC]; [Self addchildviewcontroller:nav];
Create a new project-add a navigation controller to the project