我可以强制 UITableView 隐藏空单元格之间的分隔符吗? [英] Can I force a UITableView to hide the separator between empty cells?

查看:23
本文介绍了我可以强制 UITableView 隐藏空单元格之间的分隔符吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用具有足够多单元格的普通样式 UITableView 以致 UITableView 无法在不滚动的情况下显示它们时,在下方的空白区域不会出现分隔符细胞.如果我只有几个单元格,它们下方的空白区域包含分隔符.

When using a plain-style UITableView with a large enough number of cells that the UITableView cannot display them all without scrolling, no separators appear in the empty space below the cells. If I have only a few cells the empty space below them includes separators.

有没有办法强制 UITableView 删除空白处的分隔符?如果没有,我将不得不加载一个自定义背景,并为每个单元格绘制一个分隔符,这将使继承行为变得更加困难.

Is there a way that I can force a UITableView to remove the separators in the empty space? If not I'll have to load a custom background with a separator drawn in for each cell which will make it harder to inherit behavior.

我在这里发现了一个有点类似的问题,但是我无法在我的实现中使用分组的 UITableView.

I found a somewhat similar question here, but I can't use a grouped UITableView in my implementation.

推荐答案

您可以通过为 tableview 定义页脚来实现您想要的.有关更多详细信息,请参阅此答案:消除 UITableView 下面的额外分隔符

You can achieve what you want by defining a footer for the tableview. See this answer for more details:Eliminate Extra separators below UITableView

这篇关于我可以强制 UITableView 隐藏空单元格之间的分隔符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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