UINavigationController 导航视图控制器
来源:互联网 发布:puppy linux硬盘安装 编辑:程序博客网 时间:2024/06/02 12:10
UINavigationController 导航视图控制器
1. 作用:用来管理多个视图控制器,以栈的方式管理所控制的视图控制器。
2. 运用:至少要有一个被管理的视图控制器,在初始化时必须制定一个视图控制器,
并且这个视图控制器要作为底层视图一直存在。
3. 初始化:
// 创建导航控制器时 要先指定第一个视图控制器(RootViewController)
FirstViewController *firstVC = [[FirstViewController alloc] init];
// 创建导航控制器(UINavigationController)
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:firstVC];
// 把导航控制器指定为window的根视图控制器
self.window.rootViewController = nav;
4. UINavigationBar属性的设置
// 获得当前的navigationBar 更改透明度
[self.navigationController.navigationBar setTranslucent:NO]; // 默认为YES
// 设置导航栏颜色
[self.navigationController.navigationBar setBarTintColor:[UIColor greenColor]];
// 设置导航栏文字颜色
[self.navigationController.navigationBar setTintColor:[UIColor greenColor]];
// 设置隐藏
[self.navigationController setNavigationBarHidden:YES]; // 默认为NO
5. UINavigationItem的设置
// 设置标题
self.navigationItem.title = @".....";
// 设置标题位置的view
self.navigationItem.titleView = button;
// 设置navigation左侧的按钮(UIBarButtonItem)
self.navigationItem.leftBarButtonItem
// 设置navigation右侧的按钮(UIBarButtonItem)
self.navigationItem.rightBarButtonItem
- 导航视图控制器UINavigationController
- UINavigationController 导航视图控制器
- UINavigationController(导航视图控制器)的基本设置
- Snail—UI学习之导航视图控制器UINavigationController(系统)
- iOS中的UINavigationController导航栏视图控制器的简单应用
- 导航控制器 ( UINavigationController )
- 导航控制器UINavigationController
- UINavigationController导航控制器详解
- UINavigationController导航控制器…
- UINavigationController导航控制器…
- UINavigationController导航控制器…
- UINavigationController 导航控制器
- 导航控制器UINavigationController
- 导航控制器:UINavigationController
- 自定义UINavigationController(导航控制器)
- swift UINavigationController 导航控制器
- UINavigationController 导航控制器
- UINavigationController 导航控制器
- 进入OCR。爱上OCR。
- S5PV210——指令
- 介绍几个关于C/C++程序调试的函数
- Delphi 7升级到XE2的字符串问题
- Autodesk FBX SDK Program 中文 (二)
- UINavigationController 导航视图控制器
- 深入理解JavaBean(2):属性编辑器PropertyEditor
- 关于记忆的思维图
- 搜索引擎的高级用法
- 用CasperJs自动浏览页面
- linux程序分析工具介绍(一)—-”/proc”
- 再没时间 创业时也要读下这十本经典书
- Android 利用ViewPager、Fragment、PagerTabStrip实现多页面滑动效
- android中为何第三方开源库生成的jar包不能直接放入libs中用?