iOS 设置tableView右侧索引

1.设置右侧索引字体颜色

 self.tabView.sectionIndexColor = [UIColor blackColor];

2.设置右侧索引背景色

self.cityTabView.sectionIndexBackgroundColor =[UIColor blackColor];

//显示每组标题索引

-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView

//返回每个索引的内容

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

//响应点击索引时的委托方法

-(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString*)title atIndex:(NSInteger)index

原文地址:https://www.cnblogs.com/hongyan1314/p/5790640.html