问题
I have an app that contains a view with a cell that uses the built-in cell.textLabel and a custom UITextField in cell.contentView.
I am working with Voiceover and accessibility and the desired behavior would be that whenever I tap anywhere in the cell, the accessibility element for the UITextField would be selected.
The behavior that I am actually seeing is that the cell.textLabel accessibility labels are taking over. When I don't have cell.textLabel set to anything, everything works as expected. I have also attempted to set the "isAccessibilityElement" property with no luck:
[cell.textLabel.text setIsAccessibilityElement:NO];
Does anyone know how to make this work the way I want?
回答1:
I was able to figure this out using this:
cell.textLabel.accessibilityElementsHidden = YES;
来源:https://stackoverflow.com/questions/16319769/ios-can-i-disable-accessibility-on-cell-textlabel-text