iOS更改可访问性焦点。
问题描述:
有没有办法以编程方式设置辅助功能焦点(App Store-safe)?任何帮助将不胜感激。
is there a way to set the accessibility focus programatically (App Store-safe)? Any help will be greatly appreciated.
答
专注于你可以打电话的元素。
To focus on element you can call.
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, self.myFirstElement);
否则对于iOS 8+,使用accessibilityElements设置元素顺序,它将自动聚焦于第一个元素列表
Otherwise for iOS 8+ use the accessibilityElements to set element order and it will focus automatically on first element in the list
self.accessibilityElements = @[myFirstView, mySecondButton, myThirdLabel]