UIScrollView not scrolling when setting tableView tableHeaderView

I am having difficulty scrolling through a UIScrollView instance in a UITableView when I set it as a tableHeaderView.

It still responds to touch events it pops up but doesn't want to scroll horizontally. I tried to explicitly set for setUserInteractionEnabled: YES without much luck.

Is there something special I need to do to get the scrolling to work when this is set as tableHeaderView?

Thanks.

0


a source to share


2 answers


You probably need to check your width scrollView.contentSize

, < scrollView.contentSize.width

>.



+1


a source


Embeds a UIScrollView inside a UIScrollView (since UITableView is a UIScrollView). You probably want to set the tableview canCancelContentTouches to NO so that it doesn't override your UIScrollView attacks. This can create some problems if your UITableView needs to scroll vertically.



If that's your problem, the UITableView subclass overloads touchShouldCancelInContentView: so this doesn't return YES for horizontal drags (or perhaps for title strokes).

0


a source







All Articles