gpt4 book ai didi

ios - 如何在模拟器上发布 UIAccessibility 公告?

转载 作者:行者123 更新时间:2023-12-01 16:01:35 25 4
gpt4 key购买 nike

我有一个简单的 View Controller ,它在 viewDidLoad() 中执行此操作.

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 10) {
UIAccessibility.post(notification: .announcement, argument: "Hello world.")
}
当我在我的设备上启用 Voiceover 时,这工作得很好。
但是,在模拟器上,公告不会运行。我试过使用可访问性检查器,但我无法让 Voiceover 宣布这一点。
是否有任何已知的解决方法?我正在运行 Xcode 11、iOS 13 模拟器。

最佳答案

VoiceOver 似乎无法在模拟器上运行。
它需要在设备上运行。我认为您可以在模拟器上做的最好的事情是使用可访问性检查器来检查标签、提示等

Debug Accessibility in iOS Simulator with the Accessibility Inspector

The Accessibility Inspector displays accessibility information about each accessible element in an app. You can use the Accessibility Inspector to simulate VoiceOver interaction with the accessible elements in your app to examine the information they provide.

Note: The Accessibility Inspector is helpful for testing the accessibility of your app during development, but it is no substitute for testing your app with VoiceOver on a physical device. For one thing, the Accessibility Inspector does not speak accessibility information, so you can’t hear how your element descriptions will sound. Even though the Accessibility Inspector is ideal for quickly verifying that elements supply appropriate accessibility information, you should test your app on a device, with VoiceOver turned on, to make sure that it behaves as users expect. See Test Accessibility on Your Device with VoiceOver for some tips on how to do this.


Reference

关于ios - 如何在模拟器上发布 UIAccessibility 公告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59152797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com