iOS nested scrollview — keep scrolling past top into superview?

五迷三道 提交于 2019-12-24 19:02:02

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/26265257/ios-nested-scrollview-keep-scrolling-past-top-into-superview

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!