如何在iOS 7中更改UITableView的IndexPath背景颜色?

时间:2013-09-30 04:26:12

标签: uitableview indexing ios7

我需要更改backgroundcolorIndexBar的{​​{1}} UITableView

默认情况下,iOS7 backgroundColor为白色,IndexBar为蓝色,如下图所示。

enter image description here

我想将backgroundColor更改为textColor,将clearColor更改为红色。

我怎么能在iOS7中做到这一点?

1 个答案:

答案 0 :(得分:26)

对不起。我得到了自己问题的答案。

这是代码

[[self tableView] setSectionIndexColor:[UIColor redColor]];
[[self tableView] setSectionIndexBackgroundColor:[UIColor clearColor]];