tabbar 嵌套 navigation
--------------
源代码:点击打开链接
------------------------
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的更多相关文章
- 一文搞懂Google Navigation Component
一文搞懂Google Navigation Component 应用中的页面跳转是一个常规任务, Google官方提供的解决方案是Android Jetpack的Navigation componen ...
- iOS 生命周期
应用生命周期 App启动:当App启动时,首先由not running状态切换到inactive状态,此时调用application:didFinishLaunchingWithOptions: ...
- iOS - UISplitViewController
前言 NS_CLASS_AVAILABLE_IOS(3_2) @interface UISplitViewController : UIViewController @available(iOS 3. ...
- [iOS UI进阶 - 2.0] 彩票Demo v1.0
A.需求 1.模仿“网易彩票”做出有5个导航页面和相应功能的Demo 2.v1.0 版本搭建基本框架 code source:https://github.com/hellovoidworld/H ...
- 09-UIKit(UICollectionViewController、UITabBarController)
目录: 一.UICollectionViewController 二.UITabBarController(标签控制器) 三.视图和试图控制器的生命周期 四.其他控件 回到顶部 一.UICollect ...
- Swift # 项目框架
利用Swift--简单的项目界面流程. TabBar+Navigation底部导航控制,界面的切换. GitHub源码分享,地址: URL:https://github.com/SpongeBob-G ...
- UIKit View PG
View Program iOS View and Window Architecture The view draw cycle When a view first appears on the s ...
- (六十二)纯代码搭建UI
在Xcode6中,去掉了Empty Application的选项,因此可以通过先创建SingleView,再删除storyboard,并且把工程设置中的main Interface清空. 通过AppD ...
- 【转】最近很火的 Safe Area 到底是什么
iOS 7 之后苹果给 UIViewController 引入了 topLayoutGuide 和 bottomLayoutGuide 两个属性来描述不希望被透明的状态栏或者导航栏遮挡的最高位置(st ...
随机推荐
- Linux下的文件查找类命令(转载)
如何快速有效的定位文件系统内所需要查找的文件呢?Linux为我们提供了一些文件查找类的命令,我们需要掌握以下几个命令: http://blog.csdn.net/sailor201211/articl ...
- zoj 3811 Untrusted Patrol(bfs或dfs)
Untrusted Patrol Time Limit: 3 Seconds Memory Limit: 65536 KB Edward is a rich man. He owns a l ...
- Chrome浏览器查看cookie
原文:http://jingyan.baidu.com/article/6b18230954dbc0ba59e15960.html 1. 查看页面的cookie 方法: a). 点击地址栏前面的文档薄 ...
- javascript实现的手风琴折叠菜单效果
演示地址:http://codepen.io/anon/pen/pJERMq 实现效果: HTML代码: <!DOCTYPE html> <html lang="en&qu ...
- CSS基础知识笔记(三)
继承 继承是一种规则,它允许样式不仅应用于某个特定html标签元素,而且应用于其后代.比如下面代码:如某种颜色应用于p标签,这个颜色设置不仅应用p标签,还应用于p标签中的所有子元素文本,这里子元素为s ...
- eclipse 汉化
对于: Eclipse Standard/SDK Version: Luna Release (4.4.0) 对应的网络地址:http://download.eclipse.org/technolog ...
- Tomcat 默认应用
在部署应用时需要更改默认的端口号及应用,以免让别人知道使用的服务器类型而进行攻击.tomca的部署有多种方式,这里简单谈一下.目前想到有三种方式:一.添加 Context在Tomcat的配置文件中,一 ...
- Codeforces Round #302 (Div. 1)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud A. Writing Code Programmers working on a ...
- SQL 标准中的四种隔离级别
READ UNCOMMITED(未提交读) 在RERAD UNCOMMITED级别,事务中的修改,即使没有提交,对其他事务也都是可见的.事务可以读取未提交的数据,这也成为脏读(Dirty Read). ...
- 【android】android中activity的启动模式
在AndroidManifest.xml中配置 <activity android:label="第二个应用" android:name=".Demo2Activi ...