[使用VoiceOver,UIAccessibility.post(notification: .layoutChanged, argument: someView)
只是重新宣布当前关注的元素,而不是移动焦点并宣布someView
的accessibilityLabel。即使调用UIAccessibility.post(notification: .layoutChanged, argument: "what the heck")
也不执行任何操作,只是重新声明当前关注的元素,当它应根据文档声明作为参数传递的字符串时。我目前正在模拟器上运行Xcode 11.3.1。在物理设备上也尝试过,存在同样的问题。任何帮助将不胜感激:)
post
函数实际上仅在物理设备上运行时才专注于传入的视图,并且在模拟器上似乎已损坏。 someView
不是可访问性元素。检查someView.isAccessibilityElement
是否设置为true
。