如何在iOS中以编程方式将可访问性焦点设置为按钮 [英] How to set Accessibility focus to button programmatically in iOS
本文介绍了如何在iOS中以编程方式将可访问性焦点设置为按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在iOS中,如何通过编程方式将可访问性焦点设置为按钮?
In iOS, how to set accessibility focus to a button through programmatically?
推荐答案
@ClemensL响应效果很好。
这是Swift 5版本:
@ClemensL response works great. Here is a Swift 5 version:
func setAccessibilityFocus() {
UIAccessibility.post(notification: UIAccessibility.Notification.layoutChanged, argument: self)
}
这篇关于如何在iOS中以编程方式将可访问性焦点设置为按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文