zoukankan      html  css  js  c++  java
  • UINavigationController

    1.常用方法
    1)创建导航控制器
    [[UINavigationController alloc] initWithRootViewController:self.viewController];
    2)压栈,将控制器压入栈中
    [self.navigationController pushViewController:second animated:YES];
    3)出栈,从栈中弹出控制器
    1> 弹出当前栈顶控制器
    [self.navigationController popViewControllerAnimated:YES];
    2> 跳到具体某一控制器
    [self.navigationController popToViewController:(UIViewController *) animated:(BOOL)];
    3> 跳到栈底控制器
    [self.navigationController popToRootViewControllerAnimated:YES];
    
    2.使用须知
    1> 导航控制器内部有个viewControllers属性(栈)来存放所有的子控制器
    @property(nonatomic,copy) NSArray *viewControllers; 
    2> 展示在导航控制器上面的永远是栈顶控制器的view
    
    3.导航栏内容
    1> 导航栏上面显示的内容,由当前栈顶控制器的navigationItem属性决定
    * navigationItem.title : 导航栏的中间标题(也可以直接通过控制器的title属性设置标题)
    * navigationItem.titleView : 导航栏的中间控件
    * navigationItem.leftBarButtonItem : 导航栏左边的按钮
    * navigationItem.rightBarButtonItem : 导航栏右边的按钮
    
    4.导航栏左上角的返回按钮"文字"由上一个控制器的navigationItem.backBarButtonItem决定
    * 返回按钮不需要监听(默认的操作就是出栈)
  • 相关阅读:
    MySQL内连接和外连接
    MySQL 重命名数据库
    linux查看文件大小
    Linux合并两个文件夹内容
    Linux压缩和解压命令
    深度学习反向求导
    深度学习网络压缩模型方法总结
    cuda培训素材
    cuda编程-卷积优化
    交叉熵代价函数(损失函数)及其求导推导
  • 原文地址:https://www.cnblogs.com/orzmj123/p/3500748.html
Copyright © 2011-2022 走看看