views:

32

answers:

0

I have a scroll view embedded into the tableHeaderView of a UITableView. I have a few images that the user can scroll through left/right. Pinch/zoom is not enabled.

Initially, I could scroll through the images, but only if I was extremely precise with my horizontal movement. Any deviation would be intercepted by the UITableView as a vertical scroll, and the image scroll view would snap back to place.

I've since set tableView.canCancelContentTouches to NO. This helped a little. Now, once you start a horizontal scroll, the UITableView will not override and take over if you start scrolling vertically.

However, this still doesn't feel quite right. If your initial stroke isn't perfectly horizontal, it will be picked up as a vertical scroll. Also, it has introduced a jarring "snap" effect when you're scrolling horizontally - you have to scroll a few pixels before the scroll view kicks in, and when it does, it jumps to where your finger is as if you've been scrolling all along.

The scroll view is actually a TTScrollView from the three20 library, not a UIScrollView, since this probably matters.

Can I somehow catch the touch event in the header view and disable all vertical scrolling?

Or, will using a UIScrollView instead of a TTScrollView simply do the right thing?