做项目时遇到表视图的索引条颜色(白色)挡住了表视图的headerView的背景色,像被切了一块一样,想把索引条颜色改为透明(clearColor)
可以在UITableView任意一个带:(UITableView *)tableView参数的代理方法里面实现,代码如下:
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
//更改索引的背景颜色
tableView.sectionIndexBackgroundColor = [UIColorclearColor];
//更改索引的背景颜色:
tableView.sectionIndexColor = [UIColororangeColor];
}
本文介绍如何在iOS开发中解决UITableView索引条颜色遮挡HeaderView背景的问题,并提供了一个简单的代码示例,演示如何将索引条背景颜色设置为透明。
3267

被折叠的 条评论
为什么被折叠?



