Reputation: 37985
I'm experiencing a strange issue where my UITableView
is not properly responding to taps after the scroll view it is contained within is scrolled at all. I say properly because it is highlighting the row when the cell is touched, and unhighlighting it when the finger is lifted, but there is no call made to tableView:didSelectRowAtIndexPath:
.
It doesn't matter how long you wait after scrolling. The table seems to be put into some kind of meta state after a scroll, and the first tap is ignored. Subsequent taps work fine, until you scroll again and that puts it back in the broken state.
Now I know it's not technically supported to put a tableView inside a scrollView manually, but I need to in order to visibly scroll the entire table as one, without the typical header/footer behavior of the tableView's built-in scrollView. Scrolling is disabled on the embedded tableView.
My question is does anyone know what could be causing this state, and is there anything I can set or override manually to get the tableView out of this broken state so that it will properly respond to the first tap on its cells?
I've toyed with the cancellableContentTouches
and delaysContentTouches
properties on both the containing scrollView and the embedded tableView but to no avail. It seems to happen regardless of what these are set to.
Upvotes: 4
Views: 2730
Reputation: 37985
As answered here, the correct solution (if you're not one to follow the rules) is to keep scrollEnabled
set to YES
on all embedded tableViews. This lets them handle the touches properly. But be sure to set bounces
to NO
on the embedded views to avoid weird scrolling behavior.
Upvotes: 6