crvo84
crvo84

Reputation: 303

How can I prevent accessibility voiceover from reading out the selected cell position in a collection view?

I would like the disable the behavior where the accessibility voiceover reads out the cell's position in a collection view (I'm developing for tvOS, but its probably the same behavior in iOS)

e.g. When the first cell is selected/focused (from a total of 3 items), voice over is reading "one of three".

The accessibility mode I need to support is Follow Focus.

I have already tried setting the cell's:

isAccessibilityElement = false
accessibilityTraits = .none

Upvotes: 1

Views: 1949

Answers (2)

Sore
Sore

Reputation: 186

On your cell you can try

accessibilityElementsHidden = true

for disable accessibility behavior for this cell.

But if you still want accessibility in your app, try changing the text that Voice Over will spell by setting accessibility label

accessibilityLabel = "some text that will be spoken by voiceover"

This may change whatever Voice Over will speak

Upvotes: 0

Software2
Software2

Reputation: 2748

cell.accessibilityElementsHidden = YES;

From the the Apple documentation:

The default value for this property is false. You might use this property to hide views that are covered by the arrival of a new view. In this case, the hidden views might remain visible onscreen, but they are not the focus of the user’s actions.

You might also use this property to hide a transient view that VoiceOver users don’t need to notice. For example, VoiceOver doesn’t need to describe the translucent view that appears when users adjust the volume on their devices, because the aural feedback of this action is sufficient.

Upvotes: 0

Related Questions