索引的相關(guān)屬性設(shè)置:
tableView.sectionIndexColor = [UIColor blueColor];//設(shè)置默認(rèn)時(shí)索引值顏色
tableView.sectionIndexTrackingBackgroundColor = [UIColor grayColor];//設(shè)置選中時(shí),索引背景顏色
tableView.sectionIndexBackgroundColor = [UIColor clearColor];//索引背景顏色
實(shí)現(xiàn)tableView索引相關(guān)的代理
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
-(NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView
//響應(yīng)點(diǎn)擊索引時(shí)的委托方法
-(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index;