ios - 为什么可访问性将 NSString 属性添加为静态文本?以及如何忽略它?

标签 ios uitableview nsstring accessibility voiceover

我有一个名为 ReplyCell 的自定义 UITableViewCell。代码如下:

TSSmartReplyCell.h

@interface TSSmartReplyCell : UITableViewCell
@end

TSSmartReplyCell.m

@interface TSSmartReplyCell ()
@property (strong, nonatomic) NSString *replyID;
@end

来自 Xcode 辅助功能检查器:

enter image description here enter image description here

为什么辅助功能要添加 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/

相关文章:

ios - FMDB - 错误调用 sqlite3_step (21 : out of memory) rs

ios - 如何识别 NSString 中的特殊字符?

objective-c - 获取 NSString 的 Unicode 点并将其放入另一个 NSString

ios - 当我尝试与另一个NSString比较时,NSString仅显示内存地址

ios - Ionic - 嵌入式视频不适用于 ios

ios - 有没有办法获取photoLibrary中照片的路径?

iphone - UITapGestureRecognizer 识别为 UILongPressGestureRecognizer

ios - 使表格 View 内的 UITextField 可见滚动

ios - 使用 beginUpdates/endUpdates 时,UISearchBar 从 tableHeaderView 中消失

swift - UITableViewCell背景拉伸(stretch)