我目前在我的應用程序委託中有一個UINavigationController,我在其中推送ViewController以進行登錄。如果登錄成功,我想要使用導航控制器創建一個UITabBarController作爲第一個Tab,其根控制器是我創建的UIViewController。使用UINavigationBarController以編程方式添加UITabBarController作爲第一個選項卡到現有的導航控制器
我的第一個UINavigationController的RootViewController實際上充當logincontroller的委託,所以如果用戶正確登錄,它會調用我的RootViewController中的一個方法,然後我將該方法推送到堆棧上的UITabBarController。這裏是我的代碼:
UITabBarController *tbController = [[UITabBarController alloc] init];
FileBrowserViewController *fileController = [[FileBrowserViewController alloc] init];
fileController.pathToFileDB = pathToDBUnzipped;
fileController.parentId = @"0";
UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:fileController];
NSMutableArray *aViewControllersArray = [[NSMutableArray alloc] initWithCapacity:2];
[aViewControllersArray addObject:navController];
[navController release];
[tbController setViewControllers:aViewControllersArray];
[self.navigationController pushViewController:tbController animated:YES];
[tbController release];
現在,它都工作正常。除了2件事。這裏是屏幕截圖:
1)我不能看到任何uitabbar項目。我如何設置圖片和每個標籤的文字? 2)我不想要那頂黑色的酒吧。我只想用撤銷按鈕打開1個酒吧。我如何刪除額外的欄?
感謝您的幫助!
鏈接被破壞(2012年12月28日) – CCC 2012-12-28 08:13:48