iOS学习笔记15— UINavigationController的学习体会
来源:互联网 发布:淘宝直通车基础教程 编辑:程序博客网 时间:2024/06/03 15:37
一:UINavigationBar
1.一个导航器控制个若干个视图控制器;
2.一个导航控制器包含一个NavigationBar 和一个 toolBar;
3.UINavigationBar中的 一个按钮是 UINavigationItem (only one)
4.UINavigationItem不受 UINavigationBar 控制,更不由 UINavigationController控制,是由当前的视图控制器控制;
二: toolBar :
PS: 一个UINavigationController 只有一个toolBar,切被当前视图控制,不受UINavigationController 控制
UIBarButtonItem *addBar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(button)];
UIBarButtonItem *editBar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(button )];
UIBarButtonItem *saveBar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(button )];
UIBarButtonItem *titleBar = [[UIBarButtonItem alloc] initWithTitle:@"titile" style:UIBarButtonItemStyleBordered target:self action:@selector(button)];
//设置间距
UIBarButtonItem *filexBar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil]; //等距离
//自定义间距
UIBarButtonItem *fixBar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
fixBar.width = 5;
NSArray *itemArray =@[ addBar, fixBar, editBar,filexBar, saveBar,filexBar, titleBar];
[self.navigationController setToolbarHidden:NO animated:YES];
// [self.navigationController.toolbar setItems:itemArray animated:YES]; // 错误写法,toolBar 只受当前视图的控制
[self setToolbarItems:itemArray animated:YES];//正确
- iOS学习笔记15— UINavigationController的学习体会
- IOS开发之UINavigationController的学习体会
- IOS学习笔记13—UINavigationController
- iOS学习笔记11-UITabBarController和UInavigationController的结合demo
- iOS-UINavigationController的学习
- iOS学习笔记-048.UINavigationController——导航控制器
- IOS学习笔记(5)UINavigationController UITabBarController
- iOS学习笔记-7 UINavigationController定制
- IOS学习笔记(5)UINavigationController UITabBarController
- iOS Programming 学习笔记 - 05 UINavigationController
- iOS学习笔记(6)UINavigationController
- iOS--UINavigationController学习笔记
- iOS--UINavigationController学习笔记二
- iOS--UINavigationController学习笔记三
- IOS学习七:UINavigationController控件的初步
- ios学习:UINavigationController导航
- ios学习:UINavigationController导航
- IOS学习之UINavigationController
- MSNP18协议分析(二)--- MSN登录身份认证
- windows phone:ApplicationBar图标
- AppDomain加载与释放dll
- 设置PopupWindow为圆角
- 第一次C程序设计上机报告
- iOS学习笔记15— UINavigationController的学习体会
- Problem3
- 黑马程序员-学习日记17( GUI )
- PHP对象默认按引用传递
- java读写文件大全
- linux input输入子系统分析《一》:初识input输入子系统
- golang里如何将一个struct指针转换成slice
- 线程同步
- css <a> 标签鼠标选中去除选中边框