2010-05-13 101 views

回答

11

自iOS 6.0以来,实际上可以自定义节索引的色调颜色。相关属性是:sectionIndexColorsectionIndexTrackingBackgroundColor

iOS 7添加了sectionIndexBackgroundColor它指定了节索引的背景色,而不是被触摸。

1

简而言之: 您可以更改字体大小和完整的背景(不是圆整的) 更多是不可能的。

+0

你可以做更多实际 - 看到我的帖子:http://stackoverflow.com/a/10412958/554760 – Magnus 2012-05-02 11:39:16

4

这可能有点晚,但因为我不得不面对这个问题与iOS 7我可能会帮助你。

从iOS的7有一个所谓的新方法:

@property(nonatomic, retain) UIColor *sectionIndexColor 

现在,您可以设置在不被触摸的表视图的部分指数的背景使用的颜色。

作为一个正确的代码与iOS 6使用和7,您可以:

self.friendsTableView.sectionIndexTrackingBackgroundColor = [UIColor aColor]; // background color while the index view is being touched 
if ([self.friendsTableView respondsToSelector:@selector(sectionIndexBackgroundColor)]) 
    self.friendsTableView.sectionIndexBackgroundColor = [UIColor aColor]; // background color while the index view is NOT touched at all 
2

你或许应该使用的UITableView的appearance proxy设置这些:

[UITableView appearance].sectionIndexColor = [UIColor myTintColor];

相关问题