做项目时遇到表视图的索引条颜色(白色)挡住了表视图的headerView的背景色,像被切了一块一样,想把索引条颜色改为透明(clearColor)
可以在UITableView任意一个带:(UITableView *)tableView参数的代理方法里面实现,代码如下:
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
//更改索引的背景颜色
tableView.sectionIndexBackgroundColor = [UIColorclearColor];
//更改索引的背景颜色:
tableView.sectionIndexColor = [UIColororangeColor];
}