2012-01-10 30 views
0

我還是iphone應用程序的新手。開發。 ,我使用uiNavigationController創建了基於導航的應用程序,問題是當我選擇導航控制器並將底部欄設置爲製表符時,沒有製表符出現,同樣,當我添加uitabcontroller時沒有出現製表符。如何添加製表符到UINavigationController

如何使用mainwindow.xib將選項卡添加到UINavigationController?鏈接,教程或任何建議?

回答

0

這裏的一個示例代碼,用於創建與兩個控制器一個tabBarController作爲選項卡:

myTabBarController = [[UITabBarController alloc] init]; 
NewsFeedController * newsFeedController = [[NewsFeedController alloc] initWithFacebook:facebook]; 
UINavigationController * navigationControllerHome = [[UINavigationController alloc] initWithRootViewController:newsFeedController]; 
[newsFeedController release]; 
AboutController * aboutController = [[AboutController alloc] init]; 
UINavigationController * navigationControllerAbout = [[UINavigationController alloc] initWithRootViewController:aboutController]; 
[aboutController release]; 
myTabBarController.viewControllers = [NSArray arrayWithObjects:navigationControllerHome, navigationControllerAbout, nil]; 
[self.window addSubview:myTabBarController.view]; 
相關問題