Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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:

- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index { 

My problem is that my application has just been skinned black. And so now it's hard to see the alphabet letters on the side.

I can't figure out how to change the color of the alphabet. I'd like it to be 'white' if at all possible.

like image 460
cmos Avatar asked Apr 15 '09 02:04

cmos


1 Answers

if your minimum iOS version is newer than 6.0, you can use sectionIndexColor property of UITableView.

The color to use for the table view’s index text.

@property(nonatomic, retain) UIColor *sectionIndexColor

Discussion:

Table views can display an index along the side of the view, making it easier for users to navigate the contents of the table quickly. This property specifies the color to use for text displayed in this region.


Update date 2014.1.13

I find an open source third party library:GDIIndexBar to help custom the index appearance.

like image 107
sunkehappy Avatar answered Oct 13 '22 01:10

sunkehappy