iOS 更改可访问性焦点. [英] iOS change accessibility focus.

查看:28
本文介绍了iOS 更改可访问性焦点.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法以编程方式设置可访问性焦点(App Store 安全)?任何帮助将不胜感激.

is there a way to set the accessibility focus programatically (App Store-safe)? Any help will be greatly appreciated.

推荐答案

要关注元素可以调用.

斯威夫特:

UIAccessibility.post(notification: .screenChanged, argument: self.myFirstView)

对象:

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, self.myFirstView);

否则对于 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]

这篇关于iOS 更改可访问性焦点.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆