Drag a standard button onto a view in IB and then log its isAccessibilityElement property. This returns NO, even though the documentation clearly states that it should be set to YES by default.

Am I missing something?

有帮助吗?

解决方案

My observation has been that if VoiceOver or SwitchControl is enabled then items such as UIButton return YES for -isAccessibilityElement but they often return NO otherwise.

I've been unable to identify the circumstances in which they return YES even when an access method (e.g. Voiceover) is not enabled.

EDIT: It seems that if you enable and then later disable an access method (e.g. Switch Control), -[UIButton isAccessibilityElement] will continue returning YES (even across app launches), until the device is rebooted. At least that's how my iPad Pro iOS 9.2 is behaving.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top