user2223339
user2223339

Reputation: 151

iOS nested scrollview — keep scrolling past top into superview?

So I have a table view with several cells, the last of which is a tableview itself. When I Scroll the parent table view to the bottom, I Would like the nested tableview to continue scrolling.

Essentially, when I get to the end of the parent view, I'd like it to transfer the scroll velocity to the nested view.

And also, if a user is dragging the scroll view, when it reaches the end it would begin dragging the nested view.

Any tips on transferring scroll events to nested UITableViews/UIScrollViews?

Upvotes: 0

Views: 778

Answers (1)

dadalar
dadalar

Reputation: 644

If you won't face performance issues, you can always make your last cell long enough to show all cells of the table view. That means you can't benefit from dequeueing table cells, but if you have a few rows for the embedded table view, it's the easiest way. Just give the embedded table views contentSize.height as the height of the container table views last cell.

Upvotes: 1

Related Questions