--------------

源代码:点击打开链接

------------------------

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

self.window = [[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]];

// Override point for customization after application launch.

if ([[UIDevicecurrentDevice]userInterfaceIdiom] ==UIUserInterfaceIdiomPhone) {

UIViewController *oneVC = [[OneViewControlleralloc]initWithNibName:@"one_iphone"bundle:nil];

UINavigationController *Nav1 = [[UINavigationControlleralloc]initWithRootViewController:oneVC];

UIViewController *twoVC = [[TwoViewControlleralloc]initWithNibName:@"two_iphone"bundle:nil];

UINavigationController *Nav2 = [[UINavigationControlleralloc]initWithRootViewController:twoVC];

UIViewController *threeVC = [[ThreeViewControlleralloc]initWithNibName:@"three_iphone"bundle:nil];

UINavigationController *Nav3 = [[UINavigationControlleralloc]initWithRootViewController:threeVC];

UIViewController *fourVC = [[FourViewControlleralloc]initWithNibName:@"four_iphone"bundle:nil];

UINavigationController *Nav4 = [[UINavigationControlleralloc]initWithRootViewController:fourVC];

self.tabbarController = [[UITabBarControlleralloc]init];

self.tabbarController.viewControllers =@[Nav1,Nav2,Nav3,Nav4];

}else {

UIViewController *oneVC = [[OneViewControlleralloc]initWithNibName:@"one_ipad"bundle:nil];

UINavigationController *oneNav = [[UINavigationControlleralloc]initWithRootViewController:oneVC];

UIViewController *twoVC = [[TwoViewControlleralloc]initWithNibName:@"two_ipad"bundle:nil];

UINavigationController *twoNav = [[UINavigationControlleralloc]initWithRootViewController:twoVC];

UIViewController *threeVC = [[ThreeViewControlleralloc]initWithNibName:@"three_ipad"bundle:nil];

UINavigationController *threeNav = [[UINavigationControlleralloc]initWithRootViewController:threeVC];

UIViewController *fourVC = [[FourViewControlleralloc]initWithNibName:@"four_ipad"bundle:nil];

UINavigationController *fourNav = [[UINavigationControlleralloc]initWithRootViewController:fourVC];

self.tabbarController = [[UITabBarControlleralloc]init];

self.tabbarController.viewControllers =@[oneNav,twoNav,threeNav,fourNav];

}

self.window.rootViewController =self.tabbarController;

self.window.backgroundColor = [UIColorwhiteColor];

[self.windowmakeKeyAndVisible];

return YES;

}


-------------------------

OneViewController.m

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

self = [superinitWithNibName:nibNameOrNilbundle:nibBundleOrNil];

if (self) {

// Custom initialization

self.title =@"one";

self.tabBarItem.image = [UIImageimageNamed:@"second.png"];

//navigationbar 右边的按钮

UIBarButtonItem *rightButton = [[UIBarButtonItemalloc]initWithTitle:@"下一层" style:UIBarButtonItemStyleBordered target:self action:@selector(rightTap:)];

self.navigationItem.rightBarButtonItem = rightButton;

//navigationbar 左边的按钮

UIBarButtonItem *leftButton = [[UIBarButtonItemalloc]initWithTitle:@"更多"style:UIBarButtonItemStyleBorderedtarget:selfaction:@selector(leftTap:)];

self.navigationItem.leftBarButtonItem = leftButton;

}

return self;

}


----------------------------

navigation 从第一层跳到第二层里面。。

- (IBAction)rightTap:(id)sender {

oneAViewController *VC = [[oneAViewControlleralloc]initWithNibName:@"oneA_iphone"bundle:nil];

VC.title =@"第二层";

[self.navigationControllerpushViewController:VCanimated:YES];

}

----------

显示98%。。。显示百分号%

valueLabel.text = [NSString stringWithFormat:@"%.0f%%",progressValue];


---------------------------

tabbar 嵌套 navigation的更多相关文章

  1. 一文搞懂Google Navigation Component

    一文搞懂Google Navigation Component 应用中的页面跳转是一个常规任务, Google官方提供的解决方案是Android Jetpack的Navigation componen ...

  2. iOS 生命周期

       应用生命周期 App启动:当App启动时,首先由not running状态切换到inactive状态,此时调用application:didFinishLaunchingWithOptions: ...

  3. iOS - UISplitViewController

    前言 NS_CLASS_AVAILABLE_IOS(3_2) @interface UISplitViewController : UIViewController @available(iOS 3. ...

  4. [iOS UI进阶 - 2.0] 彩票Demo v1.0

    A.需求 1.模仿“网易彩票”做出有5个导航页面和相应功能的Demo 2.v1.0 版本搭建基本框架   code source:https://github.com/hellovoidworld/H ...

  5. 09-UIKit(UICollectionViewController、UITabBarController)

    目录: 一.UICollectionViewController 二.UITabBarController(标签控制器) 三.视图和试图控制器的生命周期 四.其他控件 回到顶部 一.UICollect ...

  6. Swift # 项目框架

    利用Swift--简单的项目界面流程. TabBar+Navigation底部导航控制,界面的切换. GitHub源码分享,地址: URL:https://github.com/SpongeBob-G ...

  7. UIKit View PG

    View Program iOS View and Window Architecture The view draw cycle When a view first appears on the s ...

  8. (六十二)纯代码搭建UI

    在Xcode6中,去掉了Empty Application的选项,因此可以通过先创建SingleView,再删除storyboard,并且把工程设置中的main Interface清空. 通过AppD ...

  9. 【转】最近很火的 Safe Area 到底是什么

    iOS 7 之后苹果给 UIViewController 引入了 topLayoutGuide 和 bottomLayoutGuide 两个属性来描述不希望被透明的状态栏或者导航栏遮挡的最高位置(st ...

随机推荐

  1. MyBatis3整合Spring3、SpringMVC3

    开发环境: System:Windows WebBrowser:IE6+.Firefox3+ JavaEE Server:tomcat5.0.2.8.tomcat6 IDE:eclipse.MyEcl ...

  2. Win32/MFC的基本概念

    一.MFC的基本概念 单文档.多文档和对话框框架的区别 MFC中的类继承图的基本框架 CView类与CDocument的关系 Onpaint()和Ondraw()的关系 hdc-cdc区别联系 RUN ...

  3. JavaScript 精髓整理篇之一(对象篇)postby:http://zhutty.cnblogs.com

    废话篇头: 由于工作关系,所以写博文的时间有那么点~~,其实是输入法太懒了,都是输入法的错~~ 这一系列的博客将总结所有关于JavaScript语言的精髓,适合0基础到大师级别人物阅读. <Ja ...

  4. HashMap的存储结构及原理

    1.HashMap的数据结构(HashMap通过hashcode对其内容进行高速查找,是无序的) 数据结构中有数组和链表来实现对数据的存储,但这两者基本上是两个极端. 数组 :数组的存储区是连续的,占 ...

  5. DOS命令大全--具体解释

    在Linux和Windows下都能够用nslookup命令来查询域名的解析结果 DOS命令大全一)MD--建立子文件夹 1.功能:创建新的子文件夹 2.类型:内部命令 3.格式:MD[盘符:][路径名 ...

  6. [RxJS] Basic DOM Rendering with Subscribe

    While frameworks like Angular 2 and CycleJS provides great ways to update the DOM and handle subscri ...

  7. Codeforces 468B Two Sets 并查集

    题目大意:给出n个数,要求将n个数分配到两个集合中,集合0中的元素x,要求A-x也再0中,同理1集合. 写了几个版本号,一直WA在第8组数据...最后參考下ans,写了并查集过了 学到:1.注意离散的 ...

  8. git的0基础使用

    1.申请一个git帐号 2.项目开发者将你增加这个项目 3.在终端随意一个目录克隆 该项目地址 git clone 该项目地址 4.进nginx配置 5.更新的时候进入项目目录 git pull

  9. [置顶] VB6基本数据库应用(三):连接数据库与SQL语句的Select语句初步

    同系列的第三篇,上一篇在:http://blog.csdn.net/jiluoxingren/article/details/9455721 连接数据库与SQL语句的Select语句初步 ”前文再续, ...

  10. git 学习笔记一

    1.git的 介绍 分布式和 集中式 集中式版本控制系统最大的毛病就是必须联网才能工作,如果在局域网内还好,带宽够大,速度够快,可如果在互联网上,遇到网速慢的话,可能提交一个10M的文件就需要5分钟, ...