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

源代码:点击打开链接

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

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. <php>删除(有内容的)文件夹函数程序

    function deldir($dirname) { if(!file_exists($dirname)) {//判断文件夹是否存在 die("文件夹不存在!");//作用等于( ...

  2. 【转】修改Android工程的名称、安装路径

    申明:转载自:http://blog.csdn.net/hcj116/article/details/21712353 在Google提供的Eclipse集成开发环境adt-bundle下修改名称的总 ...

  3. php_mysql、php_mysqli 与 pdo_mysql 的区别与选择

    php与mysql的连接有三种API接口,分别是:PHP的MySQL扩展 .PHP的mysqli扩展 .PHP数据对象(PDO) ,下面针对以上三种连接方式做下总结,以备在不同场景下选出最优方案.   ...

  4. NetAnalyzer笔记 之 七 NetAnalyzer2016使用方法(1)

    [创建时间:2016-04-17 14:47:00] NetAnalyzer下载地址 距离新本的NetAnalyzer已经发布一段时间了,因为比较忙期间只出了一个视频教程,一直没有来的急写文档,今天就 ...

  5. iOS中自动释放问题?

    --前言:iOS开发中关于对象的释放问题,虽然知道规则,但总不清楚自动释放的对象什么时候彻底消失?它存在的多久?什么情况会消失?都不清楚,每次用自动释放对象,总有点心虚的感觉,以下是一些例子.研究. ...

  6. C++ Primer 学习笔记_77_模板与泛型编程 --实例化

    模板与泛型编程 --实例化 引言: 模板是一个蓝图,它本身不是类或函数.编译器使用模板产生指定的类或函数的特定版本号.产生模板的特定类型实例的过程称为实例化. 模板在使用时将进行实例化,类模板在引用实 ...

  7. android layout属性介绍

    android:id 为控件指定对应的ID android:text 指定控件其中显示的文字,须要注意的是,这里尽量使用strings.xml文件其中的字符串 android:gravity 指定Vi ...

  8. swift调用相机和相册

    简单实现swift调用相机和相册的功能,分享代码与学习swift的童鞋共同进步 import UIKit class ViewController: UIViewController,UIImageP ...

  9. Leetcode_num3_Same Tree

    题目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are ...

  10. 什么是 gnuplot

    Gnuplot是一个命令行的交互式绘图工具(command-driven interactive function plotting program).用户通过输入命令,可以逐步设置或修改绘图环境,并 ...