带有画外音的UITextView [英] UITextView with voiceover

查看:85
本文介绍了带有画外音的UITextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我创建UITextView的非常简单的代码.

Here is my very simple code for creating a UITextView.

UITextView *textView = [[UITextView alloc] initWithFrame:self.view.bounds];
textView.editable = NO;
textView.text = @"Using iOS 3.0 and later, VoiceOver is available to help users with visual impairments use their iOS-based devices. The UI Accessibility programming interface, introduced in iOS 3.0, helps developers make their applications accessible to VoiceOver users. Briefly, VoiceOver describes an application’s user interface and helps users navigate through the application’s views and controls, using speech and sound. Users familiar with VoiceOver in Mac OS X can leverage their experience to help them quickly come up to speed using VoiceOver on their devices.";
[self.view addSubview:textView];

鉴于我在这里不可能做错什么,我只是想知道这是否是预期的行为,还是可能有人遇到的错误:

Given that I could not possibly do anything wrong here I am just wondering if this is an expected behaviour or a bug perhaps somebody also faced:

启用了画外音功能后,我希望在点击时将整个文本视图突出显示",然后将其accessibilityLabel读取给用户,然后双击他们,将读取整个text view的文本.

With voiceover enabled I expect the entire text view to be "highlighted" on tap, then its accessibilityLabel to be read to a user and after they double tap, the entire text view’s text to be read.

但是正在发生的是,文本视图的一小部分被突出显示(通常为2行),未读取accessibilityLabel,但是第一行突出显示"行和第二行的第一个字母(!)而是在用户双击后才能读取整个文本.

But what is happening is that a small portion of the text view is highlighted (usually 2 lines), accessibilityLabel is not read, but the first "highlighted" line and the first letter (!) of the second line are read instead and only after a user double taps the entire text is read.

特别是阅读第二行突出显示的行中的第一个字母会使我感到困惑.另外,不应该总是一开始就读accessibilityLabel吗? 这对我来说似乎很重要,但是Apple一直非常关注可访问性,因此我怀疑是否应该报告它,可能就是这样.

Especially reading the first letter in the second highlighted line confuses me. Plus shouldn’t accessibilityLabel be always read in the beginning? This looks like a big to me but Apple has always paid so much attention to accessibility, so I’m having doubts if I should report it, may be the meant it to be this way.

另一个问题:启用画外音后,是否有一种方法可以实现以下行为(不降低UITextView的效果):用户点击UITextView-> accessibilityLabel并读取整个文本?

Another question: is there a way to achieve the following behaviour (without subleasing UITextView) when voiceover is enabled: user taps UITextView -> accessibilityLabel and the entire text are read?

推荐答案

如果其他人有此问题,请回答:

In case someone else has this problem here is the answer:

textView.accessibilityTraits = UIAccessibilityTraitStaticText;

这篇关于带有画外音的UITextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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