How do I change the color of the side Alphabet in an indexed UITableView?

后端 未结 12 961
温柔的废话
温柔的废话 2020-11-27 14:03

I have a table view with an alphabetical index and am using the side alphabet to get through the list quickly. For those not familiar, that uses this:

- (NS         


        
12条回答
  •  生来不讨喜
    2020-11-27 14:15

    We have successfully used the following code:

    for(UIView *view in [tableView subviews]) {
        if([view respondsToSelector:@selector(setIndexColor:)]) {
            [view performSelector:@selector(setIndexColor:) withObject:[UIColor whiteColor]];
        }
    }
    

    which works fine - it's very similar to Mooglas answer - but refrains from using the word "UITableViewIndex".

提交回复
热议问题