如何将基于导航的iPhone应用程序转换为基于TabBar的应用程序
我有一个iPhone应用程序,它是一个基于导航的应用程序 客户需要将60%的应用程序转换为位于全局选项卡栏中。(即在应用程序视图的60%中包含一个选项卡栏) 那么,这里的最佳实践是什么? 是否将使用IB的选项卡栏包含到如何将基于导航的iPhone应用程序转换为基于TabBar的应用程序,iphone,uitabbarcontroller,uitabbar,Iphone,Uitabbarcontroller,Uitabbar,我有一个iPhone应用程序,它是一个基于导航的应用程序 客户需要将60%的应用程序转换为位于全局选项卡栏中。(即在应用程序视图的60%中包含一个选项卡栏) 那么,这里的最佳实践是什么? 是否将使用IB的选项卡栏包含到窗口中? 或者添加或更改整个应用程序的导航代码,并按TabBarController而不是常规的ViewController 请给我一些想法 谢谢。我使用了一个新的基于窗口的应用程序,并输入了以下代码: 其思想是创建一个UITabBarController,并将Navigation
窗口中
?
或者添加或更改整个应用程序的导航代码,并按TabBarController而不是常规的ViewController
请给我一些想法
谢谢。我使用了一个新的基于窗口的应用程序,并输入了以下代码: 其思想是创建一个UITabBarController,并将NavigationController而不是ViewController放在上面 每个navigationController将导航到自己的一组ViewControllers
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UITabBarController* tabBarContoller = [[UITabBarController alloc]init];
Cross1VC* cross1VC = [[Cross1VC alloc]initWithNibName:@"Cross1VC" bundle:nil];
cross1VC.title = @"Cross 1";
UINavigationController* crossNav = [[UINavigationController alloc]initWithRootViewController:cross1VC];
crossNav.title = @"Cross";
[cross1VC release];
Part1VC* part1VC = [[Part1VC alloc]initWithNibName:@"Part1VC" bundle:nil];
part1VC.title = @"Part 1";
UINavigationController* partNav = [[UINavigationController alloc]initWithRootViewController:part1VC];
partNav.title = @"Part";
[part1VC release];
NSArray* viewControllers = [NSArray arrayWithObjects:crossNav, partNav, nil];
[tabBarContoller setViewControllers:viewControllers animated:YES];
//tabBarContoller.delegate = [[SomeDelegateHandlerClass alloc]init]; // assign, not retain
[self.window addSubview:tabBarContoller.view];
//[tabBarContoller release]; // make instance variable and release in dealloc
[self.window makeKeyAndVisible];
return YES;
}