我对iOS开发非常陌生,我想构建以下应用程序:
考虑到我有以下要求,你会如何建议我这样做:
我知道这不仅仅是一个问题,但我想给出背景,我相信一个整体策略的答案可以完全回答所有这些问题。
非常感谢你的帮助!
发布于 2012-08-06 00:07:10
只需在第四个选项卡中放置一个导航控制器,然后使用它在问题视图中导航。
每当您想回到本练习的开始时,请在[self.navigationController popToRootViewControllerAnimated:YES];方法中使用Cancel方法。
如果不想显示导航栏,可以设置
self.navigationController.navigationBar.hidden = YES;发布于 2012-08-06 06:20:10
UITabBarController *tabBarController=[[UITabBarController alloc]init];
tabBarController.delegate=self;
Screen1 *screen1=[[Screen1 alloc]init];
UINavigationController *nav2=[[UINavigationController alloc]screen1];
Screen2 *screen2=[[Screen2 alloc]init];
UINavigationController * nav3=[[UINavigationController alloc]initWithRootViewController:screen2];
UIWindow *samplewindow = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
NSArray *controllers=[NSArray arrayWithObjects:nav2,nav3, nil];
tabBarController.viewControllers=controllers;
[self.window addSubview:tabBarController.view];
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:[NSBundle mainBundle]];
samplewindow.rootViewController = self.viewController;
[samplewindow addSubview:self.viewController.view];
[samplewindow makeKeyAndVisible];如果将此代码添加到AppDelegate.m中,那么它将正常工作。
https://stackoverflow.com/questions/11821157
复制相似问题