1014 - iOS之UINavigationController类

好啦好啦,终于到UINavigationController,项目都已经快跟不上进度了。

Class

UINavigationController

--A container view controller that defines a stack-based scheme for navigating hierarchical content.

    UINavigationController是一个容器vc,基于栈模式来实现层次结构中内容之间的导航。

        

Declaration

class UINavigationController : UIViewController       //继承于UIViewController

Overview

--A navigation controller is a container view controller that manages one or more child view controllers in a navigation interface.In this type of interface, only one child view controller is visible at a time.

   navigation controller是一个管理导航界面中的多个vc的vc容器。这种导航界面一次只能让一个vc可见。通过屏幕顶部的导航栏的返回按钮返回前一个vc,通过选择vc中的某一项来将新的vc覆盖旧的vc。

--For all but the root view, the navigation controller provides a back button to allow the user to move back up the hierarchy.

    除根视图外,导航vc为每一个vc都提供了一个返回按钮,让用户返回视图层的上一层

导航vc的界面看下图:

图片来源苹果官网
图片来源苹果官网

 

--A navigation controller object manages its child view controllers using an ordered array, known as the navigation stack.

   导航vc管理子vc的栈就叫做导航栈

--The user can also remove the topmost view controller using the back button in the navigation bar or using a left-edge swipe gesture.

    客户可以通过顶部导航栏的返回按钮返回上一层视图,也可以通过左边缘手势返回。

--The navigation controller manages the navigation bar at the top of the interface and an optional toolbar at the bottom of the interface.

     导航vc提供了界面顶部的导航栏,也提供一个可选的屏幕底部的工具栏

--The navigation bar is always present and is managed by the navigation controller itself, which updates the navigation bar using the content provided by its child view controllers

    导航vc顶部的导航栏是一直存在的, 但是导航vc是通过子vc提供的内容修改顶部导航栏的,就是说导航栏仍是导航vc的,只是借用了子vc的手而已。其实,一般改来改去的都是这个导航栏而已了。

--When the isToolbarHidden property is false, the navigation controller similarly updates the toolbar with contents provided by the topmost view controller.

    当导航vc的isToolbarHidden属性值为false时,导航vc是通过栈顶的vc来更新工具栏的。工具栏是可选的,是屏幕底部的。

--A navigation controller coordinates its behavior with its delegate object.

   导航vc是通过它的委托对象来协调它的行为的。又是委托。

--The delegate object you provide must conform to the UINavigationControllerDelegate protocol.

   导航vc的委托对象必须遵循UINavigationControllerDelegate协议,所以导航vc自身也可以是自己的委托咯,遵循协议咯。

--Figure 2 shows the relationships between the navigation controller and the objects it manages. Use the specified properties of the navigation controller to access these objects.

    下图展示了导航vc与它管理的对象之间的关系。使用这些特定的属性可以访问导航vc管理的对象。

图片来源苹果官网
图片来源苹果官网

 

 

Navigation Controller Views                                                                      -- 导航控制器的视图层次

 

--You access a navigation controller’s view from its view property. This view incorporates the navigation bar, an optional toolbar, and the content view corresponding to the topmost view controller.

   你可以通过导航vc的view属性访问它的view,这个view包含了屏幕顶部的导航栏、屏幕底部的可选的工具栏、以及栈顶vc管理的内容view

--Although the content of the navigation bar and toolbar views changes, the views themselves do not. The only view that actually changes is the custom content view provided by the topmost view controller on the navigation stack.

    导航栏和工具栏视图内容虽然会发生改变是这两个view是一直存在的,不被更改的。唯一被更改的view就是你提供的栈顶vc管理的view。

下图展示了导航vc的view组成。

图片来源苹果官网
图片来源苹果官网

--Because the content view underlaps the navigation bar in iOS 7 and later, you must consider that space when designing your view controller content.

   在iOS 7 之后, 内容视图的范围从导航栏的底部延伸到屏幕的顶部

--It is permissible to customize the navigation bar’s appearance-related properties but you must never change its frame, bounds, or alpha values directly.<


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部