有没有什么办法来自定义UITableView的字母部分索引的灰色颜色?如何为UITableView的部分索引设置色调颜色?
8
A
回答
11
自iOS 6.0以来,实际上可以自定义节索引的色调颜色。相关属性是:sectionIndexColor
和sectionIndexTrackingBackgroundColor
。
iOS 7添加了sectionIndexBackgroundColor
它指定了节索引的背景色,而不是被触摸。
1
简而言之: 您可以更改字体大小和完整的背景(不是圆整的) 更多是不可能的。
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];
相关问题
- 1. 设置UITableView部分边框颜色
- 2. 如何根据TabBar选择的索引设置色调颜色?
- 3. 如何更改基于索引部分常用颜色的UITableView
- 4. 如何仅为UIImage的非白色部分设置色调颜色?
- 5. 如何为UITableView设置分隔符的颜色
- 6. 为UICollectionView部分设置背景颜色?
- 7. UIView设置色调颜色
- 8. 设置UITableViewCellStyle2色调颜色
- 9. 当部分为空时,UITableView的背景颜色变为白色
- 10. 如何将颜色设置为带索引的WPF Datagrid?
- 11. 将背景颜色设置为色调颜色
- 12. 设置TextView的部分文字颜色?
- 13. 如何为背景的特定部分设置颜色?
- 14. 更改UITableView部分标题的颜色
- 15. Git的颜色:如何设置颜色为“混帐分支-vv”上游分支?
- 16. 如何将UITableView中的单元格颜色设置为透明?
- 17. 如何为特定部分标题设置背景颜色?
- 18. 的UITableView设置IndexTitleView清除颜色
- 19. 设置UITableViewCell和UITableView背景的颜色
- 20. wxPython StyledTextCtrl设置(部分)文本颜色
- 21. Qt:如何设置QPushButton的背景颜色为系统颜色?
- 22. 为每个部分自定义UITableView部分边框颜色
- 23. Three.js设置脸部颜色
- 24. 如何为UITableView单元设置复合背景颜色?
- 25. 设置状态栏色调颜色
- 26. $。将背景颜色设置为当前设置的颜色
- 27. UITableView背景颜色设置两次
- 28. 更改UITableView标题色调颜色
- 29. 如何更改索引UITableView中边字母的颜色?
- 30. 如何在SFML中将颜色设置为alpha(移除颜色)?
你可以做更多实际 - 看到我的帖子:http://stackoverflow.com/a/10412958/554760 – Magnus 2012-05-02 11:39:16