iOS8人机交互指南(2)

前一篇: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 时做出更有依据的决定。

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 元素可以分为四个大类:

栏(Bar):栏包含上下文相关的信息,能够告诉用户他们处于何处。栏还包含控件,可以帮助用户导航或发起操作。

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

控件(Control):控件执行操作或者显示信息。

临时视图(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 中一个明显区别于其他的可见状态或模式。

NOTE

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)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 161,513评论 4 369
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 68,312评论 1 305
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 111,124评论 0 254
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,529评论 0 217
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,937评论 3 295
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,913评论 1 224
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 32,084评论 2 317
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,816评论 0 205
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,593评论 1 249
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,788评论 2 253
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,267评论 1 265
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,601评论 3 261
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,265评论 3 241
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,158评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,953评论 0 201
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 36,066评论 2 285
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,852评论 2 277

推荐阅读更多精彩内容