iOS - Can I disable accessibility on cell.textLabel.text?

China☆狼群 提交于 2019-12-11 03:43:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!