IOS UINavigationController 导航控制器
/**
导航控制器掌握:
1.创建导航控制器
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:self.viewController];
2.zhan (zhan 中所有的子控制器)
self.navigationController.viewControllers;
3.将控制器压入zhan 中
[self.navigationController pushViewController:second animated:YES];
4.将控制器从zhan 中弹出
1>将zhan 顶控制器弹了
5.导航栏显示的内容
//弹回zhan顶
//[self.navigationController popViewControllerAnimated:YES];
//回到 底控制器(根控制器)
//弹回zhan 底
[self.navigationController popToRootViewControllerAnimated:YES];
//回到哪 人控制器
//[self.navigationController popToViewController:animated:YES];
5.导航栏显示的内容
//zhan 顶控制器的navigationItem属性
self.navigationItem.title = @"你好世界";
self.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:nil action:nil];
//设置下一个界面的返回按钮
self.navigationItem.backBarButtonItem =[[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:nil action:nil];
/zhan 顶控制器的navigationItem属性决定了导航栏显示的东西@
//导航栏左边的返回键,是由上一个键决定的
//self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:nil action:nil];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"设置" style:UIBarButtonItemStyleDone target:self action:@selector(clickSetting)];
// Do any additional setup after loading the view from its nib.
6.//zhan 顶控制器
self.navigationController.topViewController;
*/
/**
1.UINavigationController的delegate
可以监听导航控制器的切换过程(显示过程)
2.执行一个Segue
[self performSegueWithIdentifier:@"login_success" sender:nil];
3.执行segue之前会调用一个方法
//可以给下一个控制器传递数据
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
*/
/**
1.UITabbarController的所有子控制器:viewControllers
2.UITabbarController可以设置delegate,监听切换过程
3.每个标签显示的内容由当前控制器的tabbarItem属性决定
self.tabBarItem.title = @"MYView";//文字
self.tabBarItem.badgeValue = @"5"; //设置红色数字
self.tabBarItem.image //图片
*/
IOS UINavigationController 导航控制器的更多相关文章
- UINavigationController导航控制器
UINavigationController导航控制器,是多个界面间跳转的重要元素,可以理解为它存储着多个viewController,它的存储结构是栈,栈的特点是先进后出,所以添加视图控制器时,要特 ...
- UINavigationController 导航控制器 ,根据文档写的一些东西
今天讲了导航控制器UINavigationController 和标签栏视图控制器UITabBarController 先来说一说导航视图控制器 UINavigationController 导航控 ...
- IOS第12天(2,UINavigationController导航控制器)
****HMAppDelegate.m @implementation HMAppDelegate - (BOOL)application:(UIApplication *)application d ...
- 【iOS开发-21】UINavigationController导航控制器初始化,导航控制器栈的push和pop跳转理解
(1)导航控制器初始化的时候一般都有一个根视图控制器,导航控制器相当于一个栈,里面装的是视图控制器,最先进去的在最以下,最后进去的在最上面.在最上面的那个视图控制器的视图就是这个导航控制器对外展示的界 ...
- iOS开发 — (UINaVigationController)导航控制器,界面传值
UINavigationController 继承于 UIViewController , 以栈的方式管理所 控制的视图控制器 . 至少要有一个被管理的视图控制器 ,这个控制器我们称作导航控制器的根视 ...
- 轻量级应用开发之(10) UINavigationController导航控制器
一 多控制器 1)一个iOS的app很少只由一个控制器组成,除非这个app极其简单2)当app中有多个控制器的时候,我们就需要对这些控制器进行管理3)有多个view时,可以用一个大的view去管理1个 ...
- iOS:导航控制器侧滑出栈实现
介绍:在iOS中,导航控制器UINavigationController是默认实现左侧边缘侧滑手势出栈的,但是如果当开发者对导航控制器子控制实现自定义leftBaButtonItem时,这个侧滑功能就 ...
- UINavigationController导航控制器初始化 导航控制器栈的push和pop跳转理解
(1)导航控制器初始化的时候一般都有一个根视图控制器,导航控制器相当于一个栈,里面装的是视图控制器,最先进去的在最下面,最后进去的在最上面.在最上面的那个视图控制器的视图就是这个导航控制器对外展示的界 ...
- IOS中导航控制器的代理及隐藏控制器刚出现时的滚动条
一.导航控制器的代理 1.UINavigationController的delegate属性 2.代理方法 1> 即将显示新控制器时调用 /* navigationController : 导航 ...
随机推荐
- AIX RAC ORA-27504 ORA-27300 ORA-27301 ORA-27302 ORA-27303
操作系统:AIX6.1 数据库:Oracle10.2.0.5 RAC 2个节点.其中一个节点正常,另外一个节点的instance的状态是offline的,手工去启动的时候报错: ORA: IPC e ...
- spring实例教程
1.配置好spring mvc发现访问无法匹配,很可能是文件放的位置或者相对目录不对. 2.实例大全:http://www.yiibai.com/spring/spring-collections-l ...
- loadrunner取出关联数组中的所有元素
方法一: int num; char nameVar[100]; char nameValue[100]; lr_save_string("AAA","name_1&qu ...
- java.util.List接口的方法subList()的使用注意事项
JDK中,List接口有一个实例方法List<E> subList(int fromIndex, int toIndex), 其作用是返回一个以fromIndex为起始索引(包含),以to ...
- Android 使用 LruCache 缓存图片
在你应用程序的 UI 界面加载一张图片是一件很简单的事情,但是当你需要在界面上加载一大堆图片的时候,情况就变得复杂起来.在很多情况下,(比如使用 ListView, GridView 或者 ViewP ...
- vs 颜色设置
工具-选项-字体和颜色:在项背景点击自定义-色调85 饱和度123 亮度205, 字体则是选择Calibri,个人认为看起来非常舒服.前景字体我选择了偏紫色,会很搭配背景浅绿色以及不会和关键字颜色搞混 ...
- 获取DLL中的方法名称
OpenFileDialog obj = new OpenFileDialog(); if (obj.ShowDialog() == System.Windows.Forms.DialogResu ...
- CodeForceS#276-A
A. Factory One industrial factory is reforming working plan. The director suggested to set a mythi ...
- poj2524-Ubiquitous Religions
C - Ubiquitous Religions Time Limit: 5000 MS Memory Limit: 65536 KB 64-bit integer IO format: %I64d ...
- jQuery Dialog and timepicker显示层的问题
timepicker官网http://timepicker.co/demos/ 当在dialogue上面调用时间选择时,时间选择的框框被dialogue窗口挡住了. 搜出来的方法说修改css,根本改不 ...