如何將UITabbarcontroller
集成到UIViewController
類中,而不是在應用程序委託中?我是想做一個登錄視圖,之後UITabBarController
出現在UIViewController
類中創建?任何人都可以建議需要做什麼?感謝UIViewController中的Uitabbarcontroller不在appdelegate中
2
A
回答
1
你仍然可以把UITabBarController
在App代表,當登錄完成後,只是告訴應用程序的委託,並切換它們:
self.window.rootViewController = tabBarController;
-2
,如果你的應用程序是基於導航應用,然後創建TabBarController(與ViewControllers你要多少添加),並將其添加上導航控制器,這樣
UITabBarController *tabBarController = [Utility configureMessagesTabBArController];
self.navigationController.navigationBarHidden=YES;
[self.navigationController pushViewController:tabBarController animated:YES];
[tabBarController release];
這裏是configureMessagesTabBArController從方法實用程序類
+(UITabBarController *)configureMessagesTabBArController
{
UITabBarController *tabBarController = [[UITabBarController alloc]init];
AktuellesViewController *aktuelles_Controller = [[AktuellesViewController alloc]init];
TermineViewController *termine_Controller = [[TermineViewController alloc]init];
TopTenViewController *topTen_Controller = [[TopTenViewController alloc]init];
MediathekViewController *mediathek_Controller = [[MediathekViewController alloc]init];
KontaktViewController *kontakt_Controller = [[KontaktViewController alloc] init];
UINavigationController *nav1 = [[UINavigationController alloc]initWithRootViewController:aktuelles_Controller];
UINavigationController *nav2 = [[UINavigationController alloc]initWithRootViewController:termine_Controller];
UINavigationController *nav3 = [[UINavigationController alloc]initWithRootViewController:topTen_Controller];
UINavigationController *nav4 = [[UINavigationController alloc]initWithRootViewController:mediathek_Controller];
UINavigationController *nav5 = [[UINavigationController alloc]initWithRootViewController:kontakt_Controller];
nav1.navigationBar.tintColor = [UIColor blackColor];
nav2.navigationBar.tintColor = [UIColor blackColor];
nav3.navigationBar.tintColor = [UIColor blackColor];
nav4.navigationBar.tintColor = [UIColor blackColor];
nav5.navigationBar.tintColor = [UIColor blackColor];
[tabBarController setViewControllers:[[NSArray alloc]initWithObjects:nav1,nav2,nav3,nav4,nav5,nil]];
[nav1 release];
[nav2 release];
[nav3 release];
[nav4 release];
[nav5 release];
[aktuelles_Controller release];
[termine_Controller release];
[topTen_Controller release];
[mediathek_Controller release];
[kontakt_Controller release];
return tabBarController;
}
相關問題
- 1. 從appDelegate中添加UITabBarController NOT?
- 2. UITabBarController中的UIViewController和UISplitViewController shouldAutorotateToInterfaceOrientation
- 3. 取向的UITabBarController + UIViewController中
- 4. 需要從appdelegate加載UIViewController並隱藏在Storyboard App中加載時的UITabBarController
- 5. 的UITabBarController與UIViewController的不tabbaritem
- 6. Segue目前從Appdelegate到UITabBarController在swift中
- 7. 的AppDelegate到的UIViewController
- 8. uitabbarcontroller + uitableviewcontroller + uiviewcontroller
- 9. UIViewController和UITabBARController
- 10. 推UIViewController到UINavigationController(也在UITabBarController中)
- 11. 如何在UITabBarController中推送UIViewController
- 12. 顯示在UITabBarController的控制器列表中不存在的UIViewController
- 13. UITabBarController中的UIViewController是黑色的
- 14. UIViewController中的UITabBarController = viewDidAppear:未調用
- 15. AppDelegate中的NSTimer不會更新UIViewController中的UILabel
- 16. UIViewController在啓動UITabBarController之前
- 17. 如何獲取當前顯示的UIViewController不在AppDelegate中?
- 18. UITabBarController和UIViewController轉換
- 19. uitabbarcontroller -jump之間uiviewcontroller
- 20. 從UIVIewController訪問UITabBarController
- 21. 從UIViewcontroller加載UITabbarcontroller
- 22. 來自AppDelegate的UIViewController方法
- 23. 在IOS中如何在特定的UIViewController中添加UITabBarController
- 24. ios uiviewcontroller uitabbarcontroller的孩子
- 25. 將StoryBoard中的UITabBarController引用到AppDelegate中的步驟
- 26. 從UIViewController導航到Appdelegate
- 27. 檢測從AppDelegate UIViewController更改
- 28. 從appdelegate設置UIViewController委託
- 29. 如何從appDelegate推UIViewController
- 30. 使用AppDelegate之外的NIB創建UITabBarController?
您是否有該先生的任何源代碼?謝謝 – Jahn 2011-12-14 08:31:32
你不需要代碼,你需要了解。在AppDelegate中有兩個IBOUtlets。一個用於登錄UIViewController,另一個用於UITabBarController。在開始時,把你的登錄UIViewController的你的rootViewController,當你完成它,只需切換爲你的UITabBarController rootViewController。 – Peres 2011-12-14 08:40:17