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 ...
随机推荐
- HTML5 拼图游戏
点击之后被选中的切片会变为透明 源代码 点击打开链接
- 【转】iOS 解决ipv6问题
解决ipv6的方法有很多种,由于现在国内的网络运营商还在使用ipv4的网络环境,所以appstore应用不可能大范围去修改自己的服务器, 而且国内的云服务器几乎没有ipv6地址. 这里附上苹果开发平台 ...
- stardict词典(星际译王)
sudo apt-get install stardict 下载词库: http://abloz.com/huzheng/stardict-dic/zh_CN/ 把下载的压缩包解压,以a为例cd /u ...
- NetAnalyzer笔记 之 三. 用C++做一个抓包程序
[创建时间:2015-08-27 22:15:17] NetAnalyzer下载地址 经过前两篇的瞎扯,你是不是已经厌倦了呢,那么这篇让我们来点有意思的吧,什么,用C#.不,这篇我们先来C++的 Wi ...
- (转)@@trancount解析
在处理事务的时候,一般都用RollBack Transaction来回滚,但是如果在嵌套事务中这样使用的话,就会出现错误. 在SqlServer里,嵌套事务的层次是由@@TranCount全局变量反映 ...
- Jquery:Jquery中的DOM操作<二>
由于昨天晚上回来的晚,写的有点匆忙,所以昨天的学习笔记中出现了多处错误的地方,幸好有各位园友帮忙指出,在这里谢过各位了!今天继续学习关于Jquery中DOM的操作,其实是昨天随笔的延续,求围观!!! ...
- vb将窗体中的控件或某种颜色透明
Option Explicit ' ******************** 窗体透明 ******************** '***Module.bas '**** Public Declare ...
- hive函数总结-字符串函数
hive 查看函数: show functions; parse_url: parse_url(url, partToExtract[, key]) - extracts a part from a ...
- Struts2.3.16.3 基本9个jar包
实践证明,Struts2.3.16.3 至少要下面9个Jar包才能正常启动. commons-fileupload-1.3.1.jar commons-logging-1.1.3.jar freema ...
- poj3122 binary search 实数区间
Pie Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14536 Accepted: 4979 Special Ju ...