I have a UITableView->UITableViewCells->UIScrollView hierarchy. If I tap on my cell, hitTest says that the touch is in the UIScrollView, and if I scroll - it also apperas to be in the UIScrollView. How can I make the touch be at the UITableViewCell level, but the scroll be at the UIScrollView level?
1 Answers
This should be a comment, but it is unfortunately too long:
The docs say:
Because a scroll view has no scroll bars, it must know whether a touch signals an intent to scroll versus an intent to track a subview in the content. To make this determination, it temporarily intercepts a touch-down event by starting a timer and, before the timer fires, seeing if the touching finger makes any movement. If the timer fires without a significant change in position, the scroll view sends tracking events to the touched subview of the content view. If the user then drags their finger far enough before the timer elapses, the scroll view cancels any tracking in the subview and performs the scrolling itself.
So, are you sure that you added your UIScrollView
as a subview to the contentView
of your table view cell, and not to the cell itself?
UIScrollView
inside of aUITableViewCell
? If so, did you add it as a subView to thecontentsView
of the cell? – Reinhard Männer