• iOS UINavigationController 详解


    developer.apple.com/cn/

    导航条   UINavigationBar继承UIView
    导航控制器    UINavigationController (压栈,出栈)
              UINavigationItem(加载导航条上的东西)
     
              UIBarButtonItem (导航条左右按钮)
     
    视图控制器     ViewController
     
    设置barTintColor 就不半透明了
     
     /zhan 顶控制器的navigationItem属性决定了导航栏显示的东西@
     
    //导航栏左边的返回键,是由上一个键决定的
     
     

    1.UINavigationController的delegate

        可以监听导航控制器的切换过程(显示过程)

     2.执行一个Segue

      [self performSegueWithIdentifier:@"login_success" sender:nil];

     3.执行segue之前会调用一个方法

     //可以给下一个控制器传递数据

     -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

     */

    UINavigationItem属于MVC中的M,封装了要显示在UiNavigationBar上的数据

    title: 标题

    titleView :标题视图

    leftBarButtonItem :左按钮

    rightBarButtonItem :右按钮

    UIBarButtonItem

    UIBarButtonItem属于MVC的M,定义了UINavigationItem上按钮的触发事件,外观等

    -initWithBarButtonSystemItem:target:action:设置按钮样式及触发事件
    -initWithTiltle:style:target:action: 设置标题的触发事件
    -initWithImage:style:target:action:设置视图的触发事件
    tintColor  设置tintColor可以影响添加在导航条上的系统样式的按钮的颜色

    导航栏

    位于导航视图最顶端的是导航栏,它是UINavigationBar类型的对象。可以显式“堆”中最顶端的视图的title属性。每一个视图控制器都有一个UINavigationItem类型的成员变量navigationItem,它有3个属性,分别是leftBarButtonItem、rightBarButtonItem和titleView。其中titleView可以是字符串或是图片,但是不能同时使用。UIBarButtonItem是其中的按钮的类型。

  • 相关阅读:
    hdu2243之AC自动机+矩阵乘法
    jstl
    HDU 3360 National Treasures 奇偶匹配的最低点覆盖
    【UVA】11992
    what is the difference between definition and declaration in c
    UVALive 6485 Electric Car Rally (BFS,PQ)
    Android发展_备份短信
    vxWorks 命令
    【C++智能指针 auto_ptr】
    Get and Post(Unity3D六个发展)
  • 原文地址:https://www.cnblogs.com/PSSSCode/p/5268725.html
Copyright © 2020-2023  润新知