2015.03.28 00:14* 字数 1228

前一篇:iOS 8人机交互指南(1)

2. iOS App 剖析(iOS App Anatomy)

Almost all iOS apps use at least some of the UI components defined by the UIKit framework. Knowing the names, roles, and capabilities of these basic components helps you make informed decisions as you design the UI of your app.

几乎所有的 iOS app 至少会使用部分由 UIKit 框架所定义的 UI 组件。了解这些基础组件的名称、角色、作用,有助于在设计 app UI 时做出更有依据的决定。


The UI elements provided by UIKit fall into four broad categories:

Bars. Bars contain contextual information that tell users where they are and controls that help users navigate or initiate actions.

Content views. Content views contain app-specific content and can enable behaviors such as scrolling, insertion, deletion, and rearrangement of items.

Controls. Controls perform actions or display information.

Temporary views. Temporary views appear briefly to give users important information or additional choices and functionality.

UIKit 提供的 UI 元素可以分为四个大类:


内容视图(Content view):内容视图包含应用相关的内容,并且能引发操作,例如滚动、插入、删除或者条目重排。


临时视图(Temporary view):临时视图短暂地出现,用来告知用户重要的信息或者额外的选择和功能。

In addition to defining UI elements, UIKit defines objects that implement functionality, such as gesture recognition, drawing, accessibility, and printing support.

Programmatically, a UI element is a type of view because it inherits from UIView. A view knows how to draw itself onscreen, and it knows when a user touches within its bounds. Controls (such as buttons and sliders), content views (such as collection views and table views), and temporary views (such as alerts and action sheets) are all types of views.

除了定义 UI 元素,UIKit 还定义了用来实现功能的对象,例如手势识别,绘制,可访问性,打印支持。

从程序的角度来讲,一个 UI 元素是一种类型的视图(view),因为它继承自 UIView。一个视图知道如何在屏幕上自我绘制,也能对用户在其界线内的触摸有所感知。控件(例如按钮和滑块)、内容视图(例如集合视图和表格视图)、临时视图(例如警告提示和动作表单)都是不同类型的视图。

To manage a set or hierarchy of views in your app, you typically use a view controller. A view controller coordinates the display of views, implements the functionality behind user interactions, and can manage transitions from one screen to another. For example, Settings uses a navigation controller to display its hierarchy of views.

Here’s an example of how views and view controllers can combine to present the UI of an iOS app.

为了管理 app 中的一系列视图,通常需要使用视图控制器(view controller)。视图控制器会协调视图的显示,实现用户交互背后的功能,还能管理屏幕间的切换。例如,设置(Settings)使用导航控制器来显示它的不同层次的视图。

下面是一个示例,介绍了视图与视图控制器是如何组合在一起来展示 iOS app 的 UI。


Although developers think in terms of views and view controllers, users tend to experience an iOS app as a collection of screens. From this perspective, a screen generally corresponds to a distinct visual state or mode in an app.

虽然开发者是从视图和视图控制器的角度来思考,但用户倾向于把 iOS app 当做一组屏幕(screen)来体验。从这个角度看,一个屏幕通常对应于 app 中一个明显区别于其他的可见状态或模式。


An iOS app includes a window. But—unlike a window in a computer app—an iOS window has no visible parts and it can’t be moved to another location on the display. Most iOS apps contain only one window; apps that support an external display can have more than one.

注:一个 iOS app 包括一个窗口(window)。但是,不同于电脑软件中的窗口,一个 iOS 窗口没有可见的部分,它也不能在显示时被移动到另一个位置。大部分 iOS app 只包含一个窗口,支持额外显示的 app 才会有不止一个窗口。

In iOS Human Interface Guidelines, the word screen is used as it’s understood by most users. As a developer, you might also read about screens in other contexts, where the term refers to the UIScreen object you can use to access an external display screen.

在 iOS 人机交互指南里使用屏幕(screen)这个词是因为它能被大多数用户所理解。作为一个开发者,你可能也会在其他上下文中读到关于屏幕(screen)的内容,而那时,这个词实际指的是 UIScreen 对象,开发者可以使用该对象来访问额外的显示屏。


后一篇:iOS 8人机交互指南(3)

Web note ad 1