views:

488

answers:

1

Hey everyone,

I'm having difficulty scrolling a UIScrollView instance in my UITableView when I set it as a tableHeaderView.

It still responds to touch events it appears, but doesn't wish to scroll horizontally. I've tried explicitly setting to setUserInteractionEnabled:YES without much luck.

Is there something in particular I need to do to get scrolling working when this is set as a tableHeaderView?

Thanks.

A: 

This embeds a UIScrollView inside a UIScrollView (since UITableView is a UIScrollView). You probably want to set the tableview's canCancelContentTouches to NO so it doesn't cancel your UIScrollView's touches. That may create some problems if your UITableView needs to scroll vertically.

If that is your issue, subclass UITableView to overload touchesShouldCancelInContentView: so that this does not return YES for horizontal drags (or perhaps for touches in the header).

Rob Napier