如何使UIScrollView具有可访问的按钮?

时间:2021-10-14 12:45:33

I have a horizontal UIScrollView with buttons. A custom toolbar at the bottom. The user can scroll it left / right.

我有一个带有按钮的水平UIScrollView。底部的自定义工具栏。用户可以滚动它的左/右。

Problem is with VoiceOver when I set the UIScrollView as self.isAccessibilityElement = YES, VoiceOver ignores the buttons on the UIScrollView.

当我将UIScrollView设置为self时,会出现画外音的问题。isAccessibilityElement = YES, VoiceOver忽略UIScrollView上的按钮。

When I don't do it, VoiceOver finds the buttons. But user can't scroll up/down.

当我不做的时候,画外音找到按钮。但是用户不能上下滚动。

1 个解决方案

#1


2  

You don't want isAccessibilityElement set to YES on the container (your UIScrollView), you only want it set on the individual buttons.

您不希望isAccessibilityElement在容器(您的UIScrollView)上设置为YES,您只希望它设置在各个按钮上。

Scrolling doesn't work the same with VoiceOver, see the "Learn VoiceOver gestures" section in the manual.

滚动和画外音不一样,参见手册中的“学习画外音手势”一节。

#1


2  

You don't want isAccessibilityElement set to YES on the container (your UIScrollView), you only want it set on the individual buttons.

您不希望isAccessibilityElement在容器(您的UIScrollView)上设置为YES,您只希望它设置在各个按钮上。

Scrolling doesn't work the same with VoiceOver, see the "Learn VoiceOver gestures" section in the manual.

滚动和画外音不一样,参见手册中的“学习画外音手势”一节。