navigationBar与tabBar

self.window=[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]];

MainViewController* vc1=[[MainViewControlleralloc]init];

MainViewController* vc2=[[MainViewControlleralloc]init];

MainViewController* vc3=[[MainViewControlleralloc]init];

MainViewController* vc4=[[MainViewControlleralloc]init];

vc1.title=@"1";

vc1.tabBarItem.image=[UIImageimageNamed:@"home"];

vc2.title=@"2";

vc2.tabBarItem.image=[UIImageimageNamed:@"home"];

vc3.title=@"3";

vc3.tabBarItem.image=[UIImageimageNamed:@"home"];

vc4.title=@"4";

vc4.tabBarItem.image=[UIImageimageNamed:@"home"];

UITabBarController* tabBar=[[UITabBarControlleralloc]init];

tabBar.viewControllers=[NSArrayarrayWithObjects:vc1,vc2,vc3,vc4,nil];

UINavigationController* navigation=[[UINavigationControlleralloc]init];

navigation.navigationBar.hidden=YES;

[navigationpushViewController:tabBaranimated:YES];

self.window.rootViewController=navigation;

[self.windowmakeKeyAndVisible];

你可能感兴趣的:(navigationBar与tabBar)