Shilpi Shilpi - 1 year ago 77
iOS Question

Turning off Voice-over focus for a cell in table view and not for others

The first cell in my table view is a dummy cell and thus, when Voice-over mode is ON, I want to skip that cell so that the focus does not come to that control
and thus, none of its traits are spoken by the Voice over. I wrote the code pasted below to acheive the same, thinking that

alone is sufficient for this. But it seems that is not the case.
Even though this element i said to be non-accessible in the code, still its getting focus by right/left flicks in
mode. Any idea as to how this can be achieved?

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(indexPath.row == 0)
cell.isAccessibilityElement = 0;


use some cutom cell, and within that cell definition implement this:

- (NSInteger)accessibilityElementCount {
    NSIndexPath *indexPath = [(UITableView *)self.superview indexPathForCell: self];
        return 0;
        return 1;