基于代码的 UITabbarController与UINavgationController 实现下导航页面切换
2014-08-07 14:22
609 查看
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; //初始化一个 UITabBarController UITabBarController *tabbarController=[[UITabBarController alloc]init]; //初始化 UINavigationController,并把UIViewController 设为rootview ZAFirstViewController *firstVC=[[ZAFirstViewController alloc]init]; firstVC.title=@"1"; UINavigationController *firstNV=[[UINavigationController alloc]initWithRootViewController:firstVC]; ZASecondViewController *secondVC=[[ZASecondViewController alloc]init]; secondVC.title=@"2"; UINavigationController *secondNV=[[UINavigationController alloc]initWithRootViewController:secondVC]; ZAThirdViewController *thirdVC=[[ZAThirdViewController alloc]init]; thirdVC.title=@"2"; UINavigationController *thirdNV=[[UINavigationController alloc]initWithRootViewController:thirdVC]; //设置UITabBarController的viewControllers数组为 UINavigationController 数组 tabbarController.viewControllers=@[firstNV,secondNV,thirdNV]; //将window的rootViewController 设置为 UITabBarController self.window.rootViewController=tabbarController; [self.window makeKeyAndVisible]; return YES; }
效果如图
相关文章推荐
- 基于Storyboard的 UITabbarController与UINavgationController 实现下导航切换
- 基于Jquery的$.cookie()实现跨越页面tabs导航实现代码
- 基于Jquery的$.cookie()实现跨越页面tabs导航实现代码
- 基于Agile Lite开发框架实现底部导航切换页面
- iOS:删除storyBoard,纯代码实现UITabBarController的视图切换功能
- 【IOS学习】视图切换,纯代码实现 UITabBarController,NavigationController
- Android基于基于布局嵌套的页面导航实现
- 基于jquery的从一个页面跳转到另一个页面的指定位置的实现代码(带平滑移动的效果)
- 基于jquery的设置页面文本框 只能输入数字的实现代码
- 网站基于flash实现的Banner图切换效果代码
- 编写一个项目,实现页面之间切换时的动画效果。上传代码并描述步骤
- UITabBarController 页面切换动画
- 简单的颜色查看页面代码——基于DOM的实现
- 基于jquery的高性能td和input切换并可修改内容实现代码
- 基于JQuery模拟的FLASH导航动画效果实现代码
- 【iOS开发-78】用代码实现UITabBarController+UINavigationController
- (一)UITabBar and UINavigationController基础教程之切换页面
- js实现单一html页面两套css切换代码
- 在html页面中插入jsp代码实现页面导航
- iOS-UINavigationController导航 页面切换效果