iOS 嵌套滚动视图 — 继续从顶部滚动到超级视图?

编程入门 行业动态 更新时间:2024-10-09 12:35:20
本文介绍了iOS 嵌套滚动视图 — 继续从顶部滚动到超级视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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

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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-29 01:51:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1182549.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   嵌套   iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!