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

源代码:点击打开链接

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

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. 第29讲 UI组件之 ListView与 BaseAdapter,SimpleAdapter

    第29讲 UI组件之 ListView与 BaseAdapter,SimpleAdapter 1.BaseAdapter BaseAdapter是Android应用程序中经常用到的基础数据适配器,它的 ...

  2. 关于背景透明,文字不透明的最佳方法,兼容IE

    以背景黑色,透明度0.5举例 非IE:background:rgba(0,0,0,0.5); IE:filter:progid:DXImageTransform.Microsoft.gradient( ...

  3. [置顶] iOS 应用程序内部国际化,不跟随系统语言

    前言:网络上关于iOS国际化的文章很多,但基本上都是基于跟随系统语言的国际化,笔者就不赘述了-0 – 今天要讲的是不跟随系统的切换语言版本方案,即程序内部的切换语言版本方案. 一.总则: 应用内部语言 ...

  4. IP转发和子网路由

    IP地址的分类 在TCP/IP协议中,协议栈分为4层.从上到下依次是应用层.运输层.网络层.网络接口层. IP协议就工作在网络层.IP协议将纷繁复杂的物理层协议屏蔽掉,对上层提供统一的描述和管理服务. ...

  5. python-操作缓存

    参考王智刚同学博客 操作Mmecached 1. 安装API python -m pip install python-memcached 2. 启动memcached memcached -d -u ...

  6. Jquery与DOM对象

    在第一次学习jquery中,常常会不能分辨DOM对象和Jquery对象,下面我们就简诉一下它们之间的关系和区别 1.DOM对象(Document Object Model) 文档对象模型,每一份DOM ...

  7. line-hight-(行高)解析

    行高定义:line-height属性是指文本行基线之间的距离. 顶线.中线.基线.底线概念 从上到下四条线分别是顶线.中线.基线.底线,很像才学英语字母时的四线三格,我们知道vertical-alig ...

  8. C#编写Windows服务程序图文教程(转载)

    Windows Service这一块并不复杂,但是注意事项太多了,网上资料也很凌乱,偶尔自己写也会丢三落四的.所以本文也就产生了,本文不会写复杂的东西,完全以基础应用的需求来写,所以不会对Window ...

  9. jwplayer修改logo右键版权

    jwplayer二次编译,可以自定义自己的logo和右键版权.

  10. 11 java 反射机制

    Java反射机制的适用场景及其利与弊: http://blog.csdn.net/zolalad/article/details/29370565 http://my.oschina.net/u/10 ...