Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
将标准按钮拖到 IB 中的视图上,然后记录其 isAccessibilityElement 属性。这将返回 NO,即使文档明确指出默认情况下应将其设置为 YES。
我错过了什么吗?
我的观察是,如果启用了 VoiceOver 或 SwitchControl,则 UIButton 等项目为 -isAccessibilityElement 返回 YES,但它们通常返回 NO 否则。
即使未启用访问方法(例如 Voiceover),我也无法确定它们返回 YES 的情况。
编辑:似乎如果您启用然后禁用访问方法(例如切换控制),-[UIButton isAccessibilityElement]将继续返回 YES(即使跨应用程序启动),直到设备重新启动。至少我的 iPad Pro iOS 9.2 是这样的。
-[UIButton isAccessibilityElement]