【问题标题】:How these UITableView section index lays over the cells这些 UITableView 部分索引如何覆盖单元格
【发布时间】:2017-03-03 21:33:53
【问题描述】:

我正在尝试获取与屏幕截图相同的 UITbaleView 部分索引,该部分索引没有任何背景并且覆盖在 UITableView 单元格上,或者换句话说右侧没有 UITableView 边距:

但我的 UITableView 在右侧有一些大约 15-20px 的 contentView 边距。

我试过self.tableView.layoutMargins = .zeroself.tableView.separatorInset = .zero,但没有用。

【问题讨论】:

    标签: ios iphone swift uitableview


    【解决方案1】:

    这实际上很容易通过以下 2 行来完成:

    tableView.sectionIndexTrackingBackgroundColor = .clear
    tableView.sectionIndexBackgroundColor = .clear
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-25
      • 1970-01-01
      • 2014-05-15
      • 2013-10-02
      • 2011-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多