索引UITableView没有节头

时间:2011-11-23 09:34:51

标签: iphone uitableview uikit

我想在没有节标题的情况下实现分组和索引的UITableView。

我正在使用sectionIndexTitlesForTableView:(UITableView *)tableView来返回我的标题。

我还实施了tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section并返回nil以及tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section并返回0.0f

两者都不会删除节标题。不同部分之间仍有空格。

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,找不到解决方法。最后,我必须继承UIViewController(不是UITableViewController)并使用透明背景的UITableView并将样式设置为UITableViewStylePlain。然后,我为第一行和最后一行(带圆角)和左右透明边距创建了自定义单元格。如果你愿意,我可以给你更多详细信息,但由于它没有直接回答你的问题,我现在暂时只分享this link

相关问题