有没有什么办法来自定义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. 如何仅为UIImage的非白色部分设置色调颜色?
- 3. 如何为UITableView设置分隔符的颜色
- 4. UIView设置色调颜色
- 5. 当部分为空时,UITableView的背景颜色变为白色
- 6. 如何将颜色设置为带索引的WPF Datagrid?
- 7. 如何为背景的特定部分设置颜色?
- 8. 更改UITableView部分标题的颜色
- 9. 的UITableView设置IndexTitleView清除颜色
- 10. 设置UITableViewCell和UITableView背景的颜色
- 11. Qt:如何设置QPushButton的背景颜色为系统颜色?
- 12. 为每个部分自定义UITableView部分边框颜色
- 13. 如何为UITableView单元设置复合背景颜色?
- 14. 更改UITableView标题色调颜色
- 15. 如何更改索引UITableView中边字母的颜色?
- 16. 如何在SFML中将颜色设置为alpha(移除颜色)?
- 17. 如何设置颜色
- 18. 如何设置正确的导航栏色调颜色?
- 19. 如何在融合图表中设置调色板的颜色?
- 20. 如何在Swift中设置右UIBarButtonItem的色调颜色?
- 21. UITableView如何更改颜色?
- 22. 如何设置部分标题的RGB颜色值 - IOS
- 23. 如何为EGOTextview设置颜色
- 24. 如何为GridViewColumn设置背景颜色
- 25. UITableView部分scrollBar的背景颜色如何表示清楚?
- 26. 将颜色设置为NSView
- 27. 为CGContextRef设置颜色
- 28. 设置用不同颜色绘制的不同部分的背景颜色jqplot
- 29. 将颜色设置为EditText占位符的一部分
- 30. 为页面的其余部分设置TCPDF背景颜色
你可以做更多实际 - 看到我的帖子:http://stackoverflow.com/a/10412958/554760 – Magnus 2012-05-02 11:39:16