iOS 嵌套滚动视图 — 继续从顶部滚动到超级视图? [英] iOS nested scrollview — keep scrolling past top into superview?

查看:35
本文介绍了iOS 嵌套滚动视图 — 继续从顶部滚动到超级视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个包含多个单元格的表格视图,其中最后一个是表格视图本身.当我将父表视图滚动到底部时,我希望嵌套的表视图继续滚动.

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.

关于将滚动事件传输到嵌套 UITableViews/UIScrollViews 的任何提示?

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

推荐答案

如果您不会遇到性能问题,您总是可以让最后一个单元格足够长以显示表格视图的所有单元格.这意味着您无法从表格单元出列中受益,但如果您有几行用于嵌入的表格视图,这是最简单的方法.只需将嵌入的表格视图 contentSize.height 作为容器表格视图最后一个单元格的高度即可.

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.

这篇关于iOS 嵌套滚动视图 — 继续从顶部滚动到超级视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆