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

查看:102
本文介绍了我可以强制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.

我发现一个有点类似的问题< a href =http://stackoverflow.com/questions/1369831/eliminate-extra-separators-below-uitableview-in-iphone-sdk>这里,但我不能使用分组 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天全站免登陆