首页 > 解决方案 > 将 UIView 添加到 UIWindow 的子视图时未检测到画外音

问题描述

我在整个应用程序中都使用了 common UIPickerView。所以,我用过UIWindow

代码:

@IBAction func show_Picker(_ sender: UIButton) { //ProfileViewController
   let testController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "pick") as! PickerViewController
   UIApplication.shared.keyWindow?.addSubview(testController.view)
}

Voiceover没有检测到这个UIWindow子视图。

PickerViewController被显示但在其自身中Voiceover循环。ProfileViewController

不知道怎么激活VoiceoverPickerViewController

谁可以帮我这个事?

标签: iosswiftvoiceoveruiaccessibility

解决方案


告诉 VoiceOver 一个构成屏幕主要部分的视图已经出现UIAccessibility.post(notification: .screenChanged, argument: newViewOrNil)


推荐阅读