0

我有一个带有自定义 UITableViewCell 的 UITableView CustomCell
CustomCell 有一些 UILabel 启用了用户交互
CustomCell 实现了 touchesBegan:

- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
UITouch* touch = touches.anyObject;
    self.itemSelected=[touch view].tag;
    self.viewSelected=[touch view];
[super touchesBegan:touches withEvent:event];
}

如果我没有启用 VoiceOver,touchesBegan 被调用,并且正确的视图被“选择”

,这很好用 VoiceOver,如果我执行“双击然后按住”,touchesBegan 也会被调用,但是与触摸事件的类型为 UITableViewCellContentView。

知道我将如何保持这些用户与 tableview 单元格内的项目的交互吗?
我尝试过的失败:
-确保在单元格对象上禁用了可访问性
-确保在标签对象上启用了可访问性
-尝试了标签的各种特征组合
-确保启用的用户交互在标签

创意上?

4

1 回答 1

2

找到了答案

我需要实现以下方法

- (NSInteger)accessibilityElementCount;
- (id)accessibilityElementAtIndex:(NSInteger)index;
- (NSInteger)indexOfAccessibilityElement:(id)element;
于 2012-10-24T17:04:59.137 回答