发个广告:iOS开发两年了,一步步走来,从小白到大白,有自己的新的体验 关注公众号一起进步,有技术、工具分享
在设置搜索ABCDEFG...的时候 可以在tableview上设置属性
self.ui_tableView.sectionIndexColor = RGB_MD(120, 209, 97); //改变abcd。。。的颜色
self.ui_tableView.sectionIndexBackgroundColor = [ColorManager clearColor]; // 改变abcdefg的背景颜色
self.ui_tableView.sectionIndexTrackingBackgroundColor = [ColorManager clearColor];
//自定义添加索引 在代理事件中这样写
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
NSMutableArray * title = [[NSMutableArrayalloc]init];
[title addObject:UITableViewIndexSearch];
for (int i='A'; i<='Z'; i++)
{
[title addObject:[NSStringstringWithFormat:@"%c",(char)i]];
}
[title addObject:@"#"];
[title addObject:@"#"];
[title addObject:@"#"];
[title addObject:@"#"];
[title addObject:@"#"];
[title addObject:@"#"];
[title addObject:@"#"];
return title;
}
//索引对应关系正常 不用重写