iOS 8人机交互指南(3)

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

3. 自适应性与布局(Adaptivity and Layout)

3.1 内置的自适应性(Build In Adaptivity)

People generally want to use their favorite apps on all their devices and in any orientation. In iOS 8 and later, you use size classes and Auto Layout to help you meet this expectation by defining how the layout of screens, view controllers, and views should adapt when the display environment changes. (The concept of display environment can refer to the entire device screen or only a portion of it, such as the area in a popover or the primary view in a split view controller.)

人们通常希望在他们所有的设备上、无论横屏竖屏,都能使用他们喜爱的 app。在 iOS 8 及之后,开发者可以使用尺寸类(size classes)和自动布局(Auto Layout)来辅助实现期望,这需要定义屏幕布局、视图控制器和视图如何随显示环境改变而自适应。(“显示环境”的概念指的是整个设备屏幕或者仅仅一部分,例如弹出框区域或者分开的视图控制器中的主要视图)

iOS defines two size classes: regular and compact. The regular size class is associated with expansive space and the compact size class is associated with constrained space. To characterize a display environment, you specify a horizontal size class and a vertical size class. As you might guess, an iOS device can use one set of size classes for portrait orientation and a different set of size classes for landscape.

iOS 定义了两种尺寸类:常规(regular)和紧密(compact)。常规尺寸类与可扩展空间相关,紧密尺寸类与约束空间相关。为了描述显示环境,可以指定一个水平尺寸类和一个垂直尺寸类。如你所想,一个 iOS 设备可以在竖屏和横屏使用不同的尺寸类集合。

iOS automatically makes various layout changes when the size classes of a display environment change. For example, when the vertical size class changes from compact to regular, navigation bars and toolbars automatically become taller.

When you rely on size classes to drive changes in the layout, your app can look great in any display environment. To learn how to work with size classes in Interface Builder, see Size Classes Design Help.

当显示环境的尺寸类发生变化时,iOS 自动进行多种布局变换。例如,当垂直尺寸类由紧密变为常规,导航栏和工具栏自动变高。

当开发者依赖尺寸类来驱动布局的改变,那么 app 可以在任何显示环境下都有不错的显示效果。参见 Size Classes Design Help 学习在 Interface Builder 中使用尺寸类的方法。

NOTE

Within a size class, continue to use Auto Layout to make small layout adjustments, such as stretching or condensing content.

注:在尺寸类里,可以继续使用自动布局来进行小的界面调整,例如延伸或紧缩内容。

The following concrete examples can help you visualize how size classes characterize the display environments of various devices. For example, iPad uses the regular size class in both dimensions and in both orientations. In other words, the iPad display environment is always horizontally and vertically regular.

下面具体的例子有助于可视化理解尺寸类如何描述多种设备上的显示环境。例如,iPad 无论尺寸大小还是横屏竖屏,都使用常规尺寸类。即,iPad 的显示环境总是水平常规且垂直常规。

iPad

The display environment of iPhone can vary depending on the device and its orientation.

iPhone 的显示环境随设备大小和横屏竖屏而变化。

(在竖屏时,iPhone 6 Plus 使用水平紧密和垂直常规的尺寸类;在横屏时,iPhone 6 Plus 使用水平常规和垂直紧密的尺寸类。)

iPhone 6 Plus

All other iPhone models, including iPhone 6, use the same sets of size classes.

除 iPhone 6 Plus 之外的所有其他 iPhone 模型,包括 iPhone 6,都使用相同的尺寸类集合。

(在竖屏时,iPhone 6、iPhone 5、iPhone 4s 都使用水平紧密和垂直常规的尺寸类;在横屏时,这些设备都使用水平紧密和垂直紧密的尺寸类。)

iPhone 6、iPhone  5、iPhone 4s

3.2 各环境下均有美好体验(Provide a Great Experience in Each Environment)

When you take advantage of adaptivity, you can ensure that your UI responds appropriately to changes in the display environment. Follow these guidelines to give people a great experience on all devices and orientations.

充分利用自适应性,可以确保 UI 随显示环境变化而及时响应。遵循这些指南带给人们全设备、无论横屏竖屏的美好体验。

Maintain focus on the primary content in all environments. This is your highest priority. People use your app to view and interact with the content they care about. Changing the focus when the environment changes can disorient people and make them feel they’ve lost control over the app.

Avoid gratuitous changes in layout. A comparable experience in all environments lets people maintain their usage patterns when they rotate a device or run your app on a different device. For example, if you use a grid to display images in a horizontally regular environment, you don’t have to display the same information in a list in a horizontally compact environment, although you might adjust the dimensions of the grid.

所有环境下均聚焦于主要内容。这是最高优先级。人们使用 app 来查看他们关心的内容,并与之交互。如果当环境改变时改变聚焦,就会使用户迷惑,让他们觉得自己好像对 app 失去了掌控。

避免布局的无故改变。在所有的环境下,让人们在旋转设备或在不同设备上运行 app 时,仍然保持他们原有的使用模式,就能对比看出问题所在。例如,如果在水平常规环境下使用网格显示图片,那就不必在水平紧密环境下用列表形式显示同样的信息,虽然可以调整网格的尺寸来实现。

Be straightforward if your app runs in only one orientation. People expect to use your app in different orientations, and it’s best when you can fulfill that expectation. But if it’s essential that your app run in only one orientation, you should:

(1)Avoid displaying a UI element that tells people to rotate the device. Running in the supported orientation clearly tells people to rotate the device, if required, without adding unnecessary clutter to the UI.

(2)Support both variants of an orientation. For example, if an app runs only in landscape, people should be able to use it whether they’re holding the device with the Home button on the right or on the left. And if people rotate the device 180 degrees while using the app, it’s best if the app responds by rotating its content 180 degrees.

如果 app 只在横屏或者竖屏下运行,那就要明确说明。人们期待在横屏和竖屏下都能使用 app,所以实现时最好按此思路。但如果 app 确有必要只在横屏或者竖屏一种情况下运行,那么应该:

(1)避免显示会引导用户旋转设备的 UI 元素。如果需要的话,在被支持的方向运行时,清晰地告知用户旋转设备,而不要对 UI 增加不必要的干扰。

(2)支持一个方向上的变种。例如,如果 app 只在横屏上运行,那无论手持设备时 Home 键在左侧还是右侧,用户都能正常使用。如果人们使用 app 过程中旋转 180 度,app 里的内容最好也相应旋转 180 度。【译者注:“iDaily 2014 年度别册”(iphone 版)就是一个很好的例子来说明上面的问题】

If your app interprets changes in device orientation as user input, handle rotation in app-specific ways. For example, a game that lets people move game pieces by rotating the device can’t respond to device rotation by rotating the screen. In a case like this, you should launch in both variants of the required orientation and allow people to switch between the variants until they start the main task of the app. As soon as people begin the main task, begin responding to device movement in app-specific ways.

如果用户输入时,app 正在解析设备方向的改变,那就用 app 特有的方式处理旋转。例如,一个游戏让用户通过旋转设备来移动游戏块,这时不能响应设备来旋转屏幕。在这样的例子中,应该启动需要的方向上所有变种,然后允许用户在变种间切换,直到他们开始 app 的主要任务。一旦用户开始主任务,再开始使用 app 特有方式响应设备移动。

3.3 使用布局来交流(Use Layout to Communicate)

Layout encompasses more than just how UI elements look on an app screen. With your layout, you show users what’s most important, what their choices are, and how things are related.

Make it easy to focus on the main task by elevating important content or functionality. Some good ways to do this are to place principal items in the upper half of the screen and—in left-to-right cultures—near the left side of the screen:

布局不仅仅是控制 UI 元素如何显示在 app 屏幕上。布局向用户展示哪些是最重要的,拥有哪些选择,以及事情如何相互关联。

提升重要的内容和功能,从而使得用户易于聚焦主要任务。达成此目的有些好方法:把最重要的条目放在屏幕上半部分、靠近屏幕左侧(按照从左到右的习惯):

界面的重要位置

Use visual weight and balance to show users the relative importance of onscreen elements. Large items catch the eye and tend to appear more important than smaller ones. Larger items are also easier for users to tap, which makes them especially useful in apps—such as Phone and Clock—that users often use in distracting surroundings.

使用可视化的重量和平衡来向用户展示屏幕元素的相对重要性。大条目引人注目,会比小条目看上去更重要。较大的条目也更易于用户点击,这使它们在 app 中尤其有用。例如它们在电话 app 和闹钟 app 中的应用就体现了它们的作用,因为用户经常在容易分心的环境中使用它们。

通话界面

Use alignment to ease scanning and communicate groupings or hierarchy. Alignment tends to make an app look neat and organized and it gives users places to focus while they scroll through screenfuls of information. Indentation and alignment of different information groups indicate how the groups are related and make it easier for users to find specific items.

Make sure that users can understand primary content at its default size. For example, users shouldn’t have to scroll horizontally to read important text, or zoom to see primary images.

Be prepared for changes in text size. Users expect most apps to respond appropriately when they choose a different text size in Settings. To accommodate some text-size changes, you might need to adjust the layout; for more information about displaying text in your app, see Text Should Always Be Legible.

使用对齐以方便快速浏览,通过分组或分层进行交流。对齐有助于使 app 看上去整洁、有条理,在用户滚动浏览满屏的信息时也有位置可以聚焦。不同信息组的缩进和对齐展示了这些组是如何被关联的,也使用户易于找到特定条目。

确保用户在缺省大小时就能理解主要的内容。例如,用户不必水平滚动来阅读重要文本,或者缩放来看到主要的图像。

对文本大小变化有所准备。当用户在设置中选择了不同的文本大小时,他们希望大部分 app 能适当地响应。为了适应某些文本大小改变,可能需要调整布局。关于 app 中显示文本的更多信息参见 Text Should Always Be Legible

As much as possible, avoid inconsistent appearances in your UI. In general, elements that have similar functions should also look similar. People often assume that there must be a reason for the inconsistencies they notice, and they’re apt to spend time trying to figure it out.

Make it easy for people to interact with content and controls by giving each interactive element ample spacing. Give tappable controls a hit target of about 44 x 44 points.

尽可能避免 UI 出现不一致。通常,具有相似功能的元素应该看上去也很相似。用户经常假设他们注意到的不一致之处必然有特别的原因,也容易花时间试图找出原因。

为每个可交互元素留出足够的空间,使得用户与内容和控件交互时更加容易。给每个可点击控件大约 44*44 像素的目标命中区域。

推荐与不推荐的做法

英文原文链接

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

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

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 8,569评论 0 23
  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,301评论 5 6
  • 聪明人和傻子,没有人愿意做傻子。可是实际上太多傻子自以为聪明,看不上那些不合规矩的傻子行为。人们都是尽力表现自己的...
    妖月淘星阅读 661评论 0 0
  • 陈达辉是今年的应届毕业生,专业是自动化设计,学校是211工程重点学校,在校期间完成几个不错的产品设计项目,参加过设...
    就聘你阅读 336评论 0 0
  • 好久都是沉在厨房和大厅之间,突然的机会可以走走公园,居然这么满足,恰巧拍下路边一棵大树上长满了的小花,便觉得生活很...
    跋涉的修行僧阅读 138评论 0 0