使用 IOS 的开关控件时如何以编程方式对项目进行分组?

How to programmatically group items when using switch control of IOS?

使用iOSSwitch Control辅助功能时,您可以开启"Group Items"以提高扫描速度。

但是有谁知道,系统如何决定哪些控件应该 grouped 在一起,哪些不应该?

我已经尝试过以多种不同的方式布置控件,但仍然无法弄清楚其中的逻辑。

谢谢

看起来应该这样做:

https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIAccessibility_Protocol/index.html#//apple_ref/occ/instp/NSObject/shouldGroupAccessibilityChildren

For example, consider an app that shows items in vertical columns. Normally, VoiceOver would navigate through these items in horizontal rows. Setting the value of this property to YES on the parent view of the items in the vertical columns causes VoiceOver to respect the app’s grouping and navigate them correctly.

所以,给分组的项目一个共同的超级视图,并将 shouldGroupAccessibilityChildren 设置为 true。