UITabBarController UINavigationController 相结合代码

UITabBarController *tabBarCtr = [[UITabBarController alloc]init];

 

SecondViewController *secondViewCtrl1=[[SecondViewController alloc]init];

UINavigationController *navCtrl1=[[UINavigationController alloc]initWithRootViewController:secondViewCtrl1];

[secondViewCtrl1 release];

 

TabBarViewController *secondViewCtrl2=[[TabBarViewController alloc]init];

UINavigationController *navCtrl2=[[UINavigationController alloc]initWithRootViewController:secondViewCtrl2];

[secondViewCtrl2 release];

 

NSArray *array=[NSArray arrayWithObjects:navCtrl1,navCtrl2,nil];

tabBarCtr.viewControllers=array;

[self presentModalViewController:tabBarCtr animated:YES];

转帖:http://blog.csdn.net/visen_api/article/details/6219839

你可能感兴趣的:(UITabBarController UINavigationController 相结合代码)