我有一个名为 ReplyCell 的自定义 UITableViewCell。代码如下:
TSSmartReplyCell.h
@interface TSSmartReplyCell : UITableViewCell
@end
TSSmartReplyCell.m
@interface TSSmartReplyCell ()
@property (strong, nonatomic) NSString *replyID;
@end
来自 Xcode 辅助功能检查器:
为什么辅助功能要添加 NSString 属性并通过 VoiceOver 读出它?如何忽略它?
我尝试在 awakeFromNib 中添加 self.isAccessibilityElement = NO 但不起作用。
最佳答案
Why accessibility add the NSString property and read it out by VoiceOver?
添加的属性被视为单元格内容的一部分,这就是屏幕阅读器将其作为默认可访问元素读出的原因。
How to ignore it?
定义accessibilityElements例如,单元格的数组,用于定义 VoiceOver 将其解释为可访问的元素。
关于ios - 为什么可访问性将 NSString 属性添加为静态文本?以及如何忽略它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59081310/