2011-09-08 69 views

回答

0

你可以簡單地做

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

UIViewController *controller1 = [[UIViewController alloc] initWithNibName:@"View1" bundle:nil]; 
controller1.title = @"View1"; 

UIViewController *controller2 = [[UIViewController alloc] initWithNibName:@"View2" bundle:nil]; 
controller1.title = @"View2"; 

tabBarController.viewControllers = [NSArray arrayWithObjects:controller1,controller2,nil]; 

[self.navigationController pushViewController:tabBarController]; 

[controller1 release]; 
[controller2 release]; 
[tabBarController release]; 
+0

我必須添加額外的代碼才能使用推視圖控制器嗎? – gikygik

+0

不明白你的問題..這段代碼實際上推送一個標籤欄控制器... – Saphrosit