这是我创建 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];
鉴于我不可能在这里做错任何事,我只是想知道这是预期的行为还是可能有人也遇到过的错误:
启用画外音后,我希望整个 TextView 在点击时“突出显示”,然后将其 accessibilityLabel
读给用户,在他们双击后,整个 text view
要读取的文本。
但是发生的事情是 TextView 的一小部分被突出显示(通常是 2 行),accessibilityLabel
没有被读取,但是第一个“突出显示”的行和第一个字母(!)而是读取第二行的内容,并且只有在用户双击后才会读取整个文本。
尤其是阅读第二个突出显示的行中的第一个字母时,我感到很困惑。另外 accessibilityLabel
不应该总是在开始时阅读吗?
这对我来说似乎是个大问题,但 Apple 一直非常关注可访问性,所以我怀疑是否应该报告它,可能就是这样的意思。
另一个问题:是否有一种方法可以在启用画外音时实现以下行为(无需转租 UITextView
):用户点击 UITextView
-> accessibilityLabel
和整个文本都被阅读了吗?
最佳答案
如果其他人有这个问题,这里是答案:
textView.accessibilityTraits = UIAccessibilityTraitStaticText;
关于ios - 带有画外音的 UITextView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26204842/