【问题标题】:Indexed UITableView without section header没有节标题的索引 UITableView
【发布时间】:2012-01-04 14:38:13
【问题描述】:

我想实现一个没有节标题的分组和索引 UITableView。

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

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

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

【问题讨论】:

  • 所以你想让表格看起来好像只有一个部分?
  • 基本上这就是我想要的,是的。
  • 在这里查看我的答案。它应该可以解决您的问题。 stackoverflow.com/questions/2817308/… 将值设置为 1。

标签: iphone uitableview uikit


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-20
    • 1970-01-01
    • 2012-03-22
    • 1970-01-01
    相关资源
    最近更新 更多