如何将UINavigationController和Tabbar添加到UIAddressBook [英] How can i add my UINavigationController and my Tabbar to UIAddressBook
本文介绍了如何将UINavigationController和Tabbar添加到UIAddressBook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为我的应用程序使用自定义的UINavigationController和UITabbar吗?
I want to use my custom UINavigationController and UITabbar for my app it is possible?
推荐答案
当然,可以使用UITabbar制作自定义navigationController.尽管我建议您在其中使用基于导航的应用程序和Tabbar.
Ofcourse it is possible to make custom navigationController with UITabbar.Though i suggest you to take a navigation based application and a Tabbar in it.
您可以使用示例代码
NSMutableArray *controllers = [[NSMutableArray alloc] init];
FirstVC *firstController = [[FirstVC alloc] initWithNibName:@"FirstVC" bundle:[NSBundle mainBundle]];
UINavigationController *firstControllerNav = [[UINavigationController alloc] initWithRootViewController:firstController];
firstControllerNav.navigationBar.barStyle = UIBarStyleBlack;
[controllers addObject:firstControllerNav];
[firstControllerNav release];
[firstController release];
SecondVC *secondController = [[SecondVC alloc] initWithNibName:@"SecondVC" bundle:[NSBundle mainBundle]];
UINavigationController *secondControllerNav = [[UINavigationController alloc] initWithRootViewController: secondController];
secondControllerNav.navigationBar.barStyle = UIBarStyleBlack;
[controllers addObject:secondControllerNav];
[secondControllerNav release];
[secondController release];
self.tabbar = [[UITabBarController alloc] init];
self.tabbar.viewControllers = controllers;
self.tabbar.customizableViewControllers = controllers;
[self.tabbar setSelectedIndex:0];
[[self.tabbar tabBarItem] setImage:@"image.png"];
欢呼
这篇关于如何将UINavigationController和Tabbar添加到UIAddressBook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文