zoukankan      html  css  js  c++  java
  • iOS UINavgationController、 UINavigationBar、 UINavigationItem关系分析

      一般导航控制器含有4个对象,UINavigationController、UINavigationBar、UIViewController、UINavigationItem。

    1:UINavigationController

      UINavigationController的父类是UIViewController(UIViewController,是所有控制器的基类),关系如下图所示:

                                 

      UINavigationController是一个视图容器,以栈的形式管理者多个内容视图(UIViewController)的换入(压入)和换出(弹出),自身提供视图切换的动

      画效果。

    2:UINavigationBar  

      UINavigationBar 的父类是UIView

         NavigaitonBar就是导航栏,位于屏幕的上方,管理整个NavigationControllernavigationItem,即类似navigationcontroller一样提供了一个栈来管

         理item

    3:UINavigationItem

      UINavigationItem的父类是NSObject

         它包含了当前页面导航栏上需要显示的全部信息:title,prompt,titleView,leftBarButtonItem,,rightBarButtonItem,backBarButonItem。

      注意:UINavigationController中会有很多个UIViewController,每个UIViewController都会对应一个自己的UINavigationItem,用来展现

      UIViewController之间的不同之处。所以我们设置每个页面标题的时候,就必须用self.navigationItem.title这个属性。

     

     

     

     

     

     

     

  • 相关阅读:
    android常用的Application类
    Android一些问题的解决方案
    MakeFile相关
    Android源码与设计模式之notifyDataSetChanged()方法与观察者模式
    Activity启动模式与onNewIntent()简述
    (转)eval与迭代
    ADB命令
    其他常用工具类
    文件操作常用工具方法
    [TJOI2007] 可爱的质数
  • 原文地址:https://www.cnblogs.com/FightingLuoYin/p/4617992.html
Copyright © 2011-2022 走看看