Accessibility is disabled for tableview cell but it is getting selected.Tableview cell is added as a subview to a view and its accessibility is also disabled.The accessibility value is coming as empty string instead of nil.Imageview is placed inside the tableview cell for that also the accessibility is disabled, still it is getting selected for the cell.Attached the view hierarchy of tableviewcell
Sample code:
BOOL voiceAccessibility = [screenDelegate getApplicationHasVoiceAccessibility];
if (voiceAccessibility) {
if (accEnabled)
{
[self setIsAccessibilityElement:YES];
if (accLable != nil && accLable.length >0)
[self setAccessibilityLabel:accLable];
}
else
{
[self setIsAccessibilityElement:NO];
self.accessibilityTraits = UIAccessibilityTraitNone;
}
}
Alternative Code tried:
-(NSString *)accessibilityLabel{
if([m_acclabel isEqualToString:@""] || m_acclabel == nil ||
m_acclabel.length == 0){
return nil;
}
return m_acclabel;
}
Accessibility Inspector Hierarchy: