I have a UITableView as an instance variable of a UIViewController which is also a UITableViewDelegate and UITableViewDataSource. The table is fixed and shorter than the screen height, so scrolling is disabled. Row selection works if you treat it very gently - a firm press with no sliding directly on the row is fine.
But any sort of quick tap, some sliding, or multitouch on the table causes the rows to flicker and no call to didSelectRowAtIndexPath is sent. For example, if row 0 is selected and currently highlighted, when you press down on row 2, it will highlight, then drag down towards row 3, nothing will be highlighted, and on lifting your finger, row 0 highlights.
Can this be improved? Is this expected behavior? Deliberate dragging is probably an intentional cancel anyways, but quick taps are something that I'd rather capture more reliably than it seems to be doing now.
here's the code where I set up the tableview:
tableView2 = [[UITableView alloc]initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y + HEADERANDFOOTERHEIGHT,
LEFTIMPORTWIDTH, self.view.frame.size.height - HEADERANDFOOTERHEIGHT * 2)];
[tableView2 setDataSource:self];
[tableView2 setDelegate:self];
tableView2.scrollEnabled = NO;
tableView2.exclusiveTouch = YES;
tableView2.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bkg_ptn_darkgraynoise.png"]];
[tableView2 setSeparatorStyle: UITableViewCellSeparatorStyleNone];
[tableView2 setRowHeight:52.0f];
[self.view addSubview:tableView2];
But I don't think there's anything odd going on in that code. I think it's just a case of me expecting better performance than the default behavior is?
exclusiveTouch
for? – Undo