如何在iOS7中为UITableView更改IndexBar的backgroundColor?

Fir*_*ist 10 indexing uitableview ios7

我需要改变backgroundcolorIndexBarUITableViewiOS7.

对于默认值,IndexBarbackgroundColor为白色,textColor如下图所示为蓝色.

在此输入图像描述

我想给的backgroundColor改变clearColortextColor红色.

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

Fir*_*ist 26

抱歉.我得到了我自己的问题的答案.

这是代码

[[self tableView] setSectionIndexColor:[UIColor redColor]];
[[self tableView] setSectionIndexBackgroundColor:[UIColor clearColor]];
Run Code Online (Sandbox Code Playgroud)