滚动时如何让第一个和最后一个UITableView单元格保持在屏幕上? [英] How can I make the first and last UITableView cells stay on screen when scrolling?

查看:73
本文介绍了滚动时如何让第一个和最后一个UITableView单元格保持在屏幕上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到在iTunesConnect iOS应用程序中,分组的UITableView的第一个和最后一个单元格保留在屏幕上,即使其他单元格正在滚动它们。他们也随着tableview移动。例如,当滚动到桌子的底部(向上移动)时,最后一个单元格随着桌子离开其在屏幕上的位置底部向上移动。

I have noticed in the iTunesConnect iOS app, the first and last cells of the grouped UITableView stay on screen even though the other cells are scrolling through them. They also move with the tableview. For example when scrolling to the bottom of the table (moving up), the last cell moves up with the table as it leaves the bottom of its position on screen.

有没有人举例说明如何做到这一点?我已经尝试设置页眉和页脚视图,但这些在移动tableView时滚动屏幕。

Does anyone have an example of how this could be done? I have tried setting the header and footer views but these scroll off screen when moving the tableView.

谢谢。

推荐答案

我认为最好的方法是使用带有页眉和页脚设置的普通UITableView,并将自定义UITableViewCells的皮肤/主题看作分组的UITableViewCells。

I think the best approach would be to use a plain UITableView with Header and Footer set, and "skin"/theme your custom UITableViewCells to look like grouped UITableViewCells.

你可能想看看这里有关如何实现这一目标的一些指示。

you'd might want to have a look over here for some pointers on how to achieve this.

这篇关于滚动时如何让第一个和最后一个UITableView单元格保持在屏幕上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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