iOS 辅助功能、VoiceOver 阅读顺序问题 [英] Accessibility for iOS, VoiceOver read order issue

查看:39
本文介绍了iOS 辅助功能、VoiceOver 阅读顺序问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在完成双指向下滑动"手势后,是否可以更改 iPad 中用于辅助功能的 VoiceOver 功能读出元素的顺序?

Is it possible to change the order in which the VoiceOver feature for accessibility in iPad reads out the elements, when the 'Two-finger Flick Down' gesture is done?

对于包含 3 个标签和一个按钮的附加图像,VoiceOver 以下列方式读取元素,

For the attached image, which contains 3 labels and a button, the VoiceOver reads the elements in the following way,

标签 1 -> 标签 2 -> 按钮 -> 标签 3

Label 1 -> Label 2 -> Button -> Label 3

订单可以改成吗,

标签 1 -> 标签 2 -> 标签 3 -> 按钮

Label 1 -> Label 2 -> Label 3 -> Button

推荐答案

在您的示例中实现此目的的最快方法是将三个标签放在一个透明的 UIView 子类中作为容器你的标签.这个子类必须正确设置,才能让 VoiceOver 知道如何解释它.如果您的部署目标是 iOS6,那么您可以简单地回答这个子类中的应该将无障碍儿童分组"问题.

The quickest way to achieve this for your example is to place the three labels in a transparent UIView subclass to serve as a container for your labels. This subclass will have to be properly setup to let VoiceOver know how to interpret it. If your deployment target is iOS6 then you can simply answer the "should group accessibility children" question in this subclass.

-(BOOL)shouldGroupAccessibilityChildren{
    return YES;
}

对于下面的 iOS6,它会更复杂,除了您的 UIView 容器子类将只包含 UILabels 这是可访问性元素.你可以这样实现:

For below iOS6 it would be more complicated, except that your UIView container subclass would contain only UILabels which are accessibility elements. You could implement it like this:

-(BOOL)isAccessibilityElement{
    return NO;
}
-(NSInteger)accessibilityElementCount{
    return self.subviews.count;
}
-(id)accessibilityElementAtIndex:(NSInteger)index{
    return [self.subviews objectAtIndex:index];
}
-(NSInteger)indexOfAccessibilityElement:(id)element{
    return [self.subviews indexOfObject:element];
}

我已经测试了这个示例代码,它可以满足您的要求,如果您需要任何说明,请添加评论.总是乐于帮助使事情变得更易于访问.

I have tested this example code and it does what you are looking for, if you need any clarification please add a comment. Always happy to help make things more accessible.

这篇关于iOS 辅助功能、VoiceOver 阅读顺序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆