标签:ios开发 移动互联网 objective-c 视图控制器
UINavigationController
class
implements a specialized view controller that manages the navigation of hierarchical content. UINavigationController
类为管理具有一定层次结构的内容实现了专门的视图控制器。pushViewController:animated:
method.Pushing
a view controller displays its view in the navigation interface and updates the navigation controls accordingly. pushViewController:animated:
方法,当push一个视图控制器时,视图控制器会将它自己的视图显示到导航界面并更新相应的导航控制。popViewControllerAnimated:
method. popViewControllerAnimated:
方法。UINavigationControllerDelegate
protocol.UINavigationControllerDelegate
协议。view
property.
This view incorporates the navigation bar, an optional toolbar, and the content view corresponding to the topmost view controller. view
属性访问导航控制器的view。这个view包括一个navigation
bar、一个toolbar、和最顶层视图控制器的内容视图。frame
, bounds
,
or alpha
values
directly. If you subclass UINavigationBar
,
you must initialize your navigation controller using the initWithNavigationBarClass:toolbarClass:
method.
To hide or show the navigation bar, use the navigationBarHidden
property
or setNavigationBarHidden:animated:
method.frame
, bounds
或alpha
值。如果你子类化了UINavigationBar
,你必须使用initWithNavigationBarClass:toolbarClass:
方法初始化你的导航控制器。显示或隐藏navigation
bar,可以设置其navigationBarHidden
属性,或使用setNavigationBarHidden:animated:
方法。UINavigationItem
class)
associated with the view controllers on the navigation stack. To change the contents of the navigation bar, you must therefore configure the navigation items of your custom view controllers. For more information about navigation items, see UINavigationItem
Class Reference.UINavigationItem
类的实例)动态的构建navigation
bar的内容,因此想要改变navigation bar的内容,你必须配置你自己定制的视图控制器的navigation items。关于UIBarButtonItem
class.
You can create items with custom content or create standard system items depending on your needs. For more information about how to create bar button items, see UIBarButtonItem
Class Reference.UIBarButtonItem
类的实例。你可以根据你的需要用自定义的内容创建items,也可以创建系统标准的items。更多关于如何创建button
items的内容,请阅读UIBarButtonItem Class Reference。leftBarButtonItem
property
of the view controller’s navigation item.leftBarButtonItem
属性指定一个定制的left
bar button item。backBarButtonItem
property,
the navigation bar displays that item.backBarButtonItem
属性里面有一个对象,navigation
bar将会显示这个item。title
property
of the previous view controller—that is, the view controller one level down on the stack. (If there is only one view controller on the navigation stack, no back button is displayed.)title
属性的值,前一个视图控制器也就是在导航栈中比当前视图控制器低一个层级的视图控制器。(如果仅有一个视图控制器在导航栈里面,那么返回按钮将不会显示。)
NOTE
leftBarButtonItem
or leftBarButtonItems
property
of its navigation item—the navigation bar does not change the button title.leftBarButtonItem
和 leftBarButtonItems属性有对象,navigation
bar不会修改按钮标题。
titleView
property
of the view controller’s navigation item.titleView
属性指定一个定制的title
view。title
property
of the view controller itself. If you want to display a different title than the one associated with the view controller, set the title
property
of the view controller’s navigation item instead.title
属性获得的。如果你想显示一个与视图控制器相关联的标题不相同的标题,你可以设置视图控制器navigation
item的title
属性。rightBarButtonItem
property
of the view controller’s navigation item.rightBarButtonItem
属性指定一个定制的right
bar button item。tintColor
property
to change the tint color of items in the bar and use the barTintColor
property
to change the tint color of the bar itself. Navigation bars do not inherit their tint color from the currently displayed view controller.tintColor
属性改变navigation
bar中items的tint color,使用barTintColor
属性改变navigation
bar自身的tint color。navigation bar不会从当前显示的视图控制器来继承tint
color。toolbarItems
property
of the active view controller. When the active view controller changes, the navigation controller updates the toolbar items to match the new view controller, animating the new items into position when appropriate.toolbarItems
属性获取它当前的items的集合。当活动的视图控制器发生改变,导航控制器就会更新toolbar的items以匹配新的视图控制器,并动画新的items到合适的位置。setToolbarHidden:animated:
method
of your navigation controller object. If not all of your view controllers support toolbar items, your delegate object can call this method to toggle the visibility of the toolbar during subsequent push and pop operations. To use a custom UIToolbar
subclass,
use the initWithNavigationBarClass:toolbarClass:
method
to initialize the navigation controller.setToolbarHidden:animated:
方法将它设置为显示。如果你并不是所有的视图控制器都支持toolbar
items,你可以在随后的push或pop操作时,用委托对象发送这个消息来让toolbar隐藏或显示。如果要使用一个自定义的UIToolbar
子类,需要使用initWithNavigationBarClass:toolbarClass:
方法初始化导航控制器。restorationIdentifier
property,
it attempts to preserve the child view controllers on its navigation stack. The navigation controller starts at the bottom of the stack and moves upward, encoding each view controller that also has a valid restoration identifier string. During the next launch
cycle, the navigation controller restores the preserved view controllers to the navigation stack in the same order that they were preserved.restorationIdentifier
属性指定一个值,它会试图去保存它所在的导航栈里面的子视图控制器。导航控制器从栈底开始向上移动,编码每一个有有效恢复标识字符串的视图控制器。在下一次的启动循环中,导航控制器按照之前保存的顺序恢复视图控制器到导航栈中。标签:ios开发 移动互联网 objective-c 视图控制器
原文地址:http://blog.csdn.net/debolee/article/details/46418201