美文网首页
修改tableview索引条背景颜色变透明或其他颜色的方法

修改tableview索引条背景颜色变透明或其他颜色的方法

作者: 消失666 | 来源:发表于2017-11-16 17:34 被阅读0次

做项目时遇到表视图的索引条颜色(白色)挡住了表视图的headerView的背景色,像被切了一块一样,想把索引条颜色改为透明(clearColor)

可以在UITableView任意一个带:(UITableView*)tableView参数的代理方法里面实现,代码如下:

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

{

//更改索引的背景颜色

tableView.sectionIndexBackgroundColor= [UIColorclearColor];

//更改索引的背景颜色:

tableView.sectionIndexColor= [UIColororangeColor];

}

相关文章

网友评论

      本文标题:修改tableview索引条背景颜色变透明或其他颜色的方法

      本文链接:https://www.haomeiwen.com/subject/njcrvxtx.html