ios辅助功能_何时使用辅助功能标签

ios辅助功能

There are a few circumstances when you’ll want to set your own accessibility label, such as…

在某些情况下,您需要设置自己的辅助功能标签,例如…

  1. An interactive element that you haven’t given a text value to, such as an image button.

    您没有赋予text值的交互式元素,例如图像按钮。

  2. An interactive element with a long visual label.

    具有长视觉标签的交互式元素。
  3. An interactive element with a short visual label that takes context from your design.

    带有短视觉标签的交互式元素,可从您的设计中获取上下文。
  4. A control or view you have created yourself or built by combining elements.

    您自己创建或通过组合元素构建的控件或视图。
  5. Images of text.

    文字图片。

没有文本值的元素 (Elements Without a text value)

Take the controls for a music player as an example. Below is a screenshot of the controls for Spotify’s music player, each icon is a button. They’re all visual, but not text. As they’re buttons they’re all available to assistive technology but without a text value, assistive technologies would not know how to present each button to your user. VoiceOver would likely read each as ‘button’ giving no indication what each button does. Voice Control users would have to refer to each button by a number based on the order it appears on the screen.

以音乐播放器的控件为例。 下面是Spotify音乐播放器控件的屏幕截图,每个图标都是一个按钮。 它们都是可视的,但不是文本。 因为它们是按钮,所以它们都可用于辅助技术,但是没有文本值,因此辅助技术将不知道如何向用户显示每个按钮。 VoiceOver可能会将每个按钮读为“按钮”,而没有指示每个按钮的功能。 语音控制用户将必须根据每个按钮在屏幕上显示的顺序按数字进行引用。

Instead, Spotify add accessibility labels to each of these buttons, you can see these labels below. Each label is short and tells our user exactly what will happen if they activate it.

相反,Spotify将可访问性标签添加到每个按钮中,您可以在下面看到这些标签。 每个标签都是简短的,并告诉我们的用户如果激活它将会发生什么。

Play controls for Spotify showing accessibility labels

带有长标签的元素 (Elements with a long label)

Sometimes your buttons, or other interactive elements, will have really long labels. Take this example from Bear. This is a table cell which is fully tappable — see in this image VoiceOver highlights the whole cell.

有时您的按钮或其他交互式元素会带有很长的标签。 以Bear为例。 这是一个完全可轻按的表格单元格-在此图像中看到VoiceOver突出显示了整个单元格。

Bear’s notes list

The cell features the note’s title and a couple of lines of the note’s content. That’s a lot of content to listen to VoiceOver read or to say to Voice Control. So instead of using the whole text on the cell, Bear set the cell’s accessibility label to just the title of the note. Additionally, the cell features the time elapsed since this note was edited, this is the first piece of text visually, but it’s not the most important. So Bear have moved this information to the end of the accessibility label.

该单元格具有注释的标题和注释内容的几行内容。 听VoiceOver读或对Voice Control说的内容很多。 因此,Bear不用在单元格上使用整个文本,而是将单元格的可访问性标签设置为注释的标题。 此外,该单元格还具有自编辑该便笺以来经过的时间,这是视觉上的第一段文字,但这并不是最重要的。 因此,贝尔斯登将此信息移到了辅助功能标签的末尾。

Bear’s notes list showing accessibility labels

This makes navigation simpler and faster, importantly without losing context. Use this technique thoughtfully, removing content can lead to a worse experience, so to make sure you get the best result, test this with regular VoiceOver users.

这使导航变得更简单,更快捷,重要的是不会丢失上下文。 认真使用此技术,删除内容可能会导致更糟的体验,因此,为确保获得最佳效果,请与常规VoiceOver用户进行测试。

需要额外上下文的元素 (Elements requiring extra context)

Take a shopping app as an example. Say the screen has a table of search results and each row has an ‘add to basket’ button. When swiping through the list, how would someone who can’t see the layout of the screen know what the ‘add to basket’ button applies to? It could be for the previous title VoiceOver read, or it could be for the next one. Setting the accessibility label of the ‘add to basket’ button to ‘add {item name} to basket’ clears up this confusion.

以购物应用程序为例。 假设屏幕上有一张搜索结果表,每一行都有一个“添加到购物篮”按钮。 滑动列表时,看不见屏幕布局的人怎么知道“添加到购物篮”按钮适用于什么? 它可以用于VoiceOver阅读的上一个标题,也可以用于下一个标题。 将“添加到购物篮”按钮的可访问性标签设置为“将{商品名称}添加到购物篮”可以消除这种混乱。

Here’s an example from the BBC Sounds app. Each row in this table has a play button after it.

这是来自BBC Sounds应用程序的示例。 该表中的每一行后面都有一个播放按钮。

BBC Sounds Music Mixes list

To disambiguate what each play button does, the accessibility labels don’t just say ‘play’ but ‘play {name of mix}’.

为了消除每个播放按钮的歧义,可访问性标签不仅显示“播放”,还显示“播放{mix of name}”。

BBC Sounds Music Mixes list showing accessibility labels

您的自定义视图 (Your Custom Views)

If you’re combining views together to create a new control, iOS won’t know what part of that view is the important part to present to assistive technologies. So, in this case, you’ll need to add some code to the root view of your new control to pass that label to your customer in the form of an accessibility label.

如果将视图合并在一起以创建新控件,iOS将不知道该视图的哪一部分是呈现给辅助技术的重要部分。 因此,在这种情况下,您需要向新控件的根视图中添加一些代码,以可访问性标签的形式将该标签传递给客户。

文字图片 (Images of Text)

As a general rule, avoid images of text if you can. But if you have to use an image that includes text, ensure you add the same text as an accessibility label to the image, otherwise people with no, or low, vision won’t know what the text is.

通常,请尽量避免显示文字图像。 但是,如果您必须使用包含文本的图像,请确保为该图像添加与可访问性标签相同的文本,否则,视力不佳或视力不佳的人将不知道该文本是什么。

何时不使用辅助功能标签 (When Not to Use an Accessibility Label)

Ensuring your on-screen elements have meaningful labels is an important step for improving accessibility, but just as important is knowing when not to add labels. Adding labels where they aren’t needed makes for a noisy experience, and can make navigating your app take longer, and be more confusing.

确保屏幕上的元素具有有意义的标签是改善可访问性的重要步骤,但同样重要的是知道何时不添加标签。 在不需要的地方添加标签会带来嘈杂的体验,并且会使您的应用导航花费更长的时间,并且更加混乱。

装饰元素 (Decorative Elements)

Decorative elements can be icons that aren’t buttons, smaller images such as thumbnails, layout elements, and other elements that have no explicit meaning shouldn’t have an accessibility label applied, and should all be marked as hidden to accessibility. Larger images or photos should probably have a short descriptive label added. Otherwise, it can be confusing for those with low vision who can tell something is present on screen, but not what.

装饰元素可以是不是按钮的图标,缩略图,布局元素之类的较小图像以及其他没有明确含义的元素,不应应用可访问性标签,并且应将所有元素都标记为隐藏以表示可访问性。 较大的图像或照片可能应该添加简短的描述性标签。 否则,对于那些视力不佳的人来说,他们可以分辨出屏幕上出现的东西,而不是什么,可能会造成混淆。

如果标签能胜任 (If Your Label Does the Job)

If your element already has a text label, that’s great in most cases. Don’t change it just for the sake of doing something. You risk making the accessible experience worse.

如果您的元素已经具有文本标签,则在大多数情况下都很好。 不要仅仅为了做某事而更改它。 您有冒险使无障碍体验恶化。

下一个 (Next Up)

The next blog in this series is Writing Great iOS Accessibility LabelsThe previous article in this series is iOS Accessibility Labels

本系列的下一个博客是编写出色的iOS辅助 功能标签。

This post was originally published on mobilea11y.com. Visit Mobile A11y for more mobile accessibility tools and techniques.

该帖子最初发布在mobilea11y.com上 。 访问Mobile A11y,以获取更多的移动辅助工具和技术。

翻译自: https://medium.com/macoclock/when-to-use-accessibility-labels-843a48896dc1

ios辅助功能

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值