ios 开发资源整合

修改tableView侧栏索引的背景色

2016-11-28  本文已影响28人  Daimer

tableView侧栏索引的背景色默认是白色,但是可以通过以下属性修改

1.修改index文字颜色

@property (nonatomic, strong, nullable) UIColor *sectionIndexColor NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR;                   // color used for text of the section index

2.修改背景色

@property (nonatomic, strong, nullable) UIColor *sectionIndexBackgroundColor NS_AVAILABLE_IOS(7_0) UI_APPEARANCE_SELECTOR;         // the background color of the section index while not being touched

3.修改点击后的背景色

@property (nonatomic, strong, nullable) UIColor *sectionIndexTrackingBackgroundColor NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR; // the background color of the section index while it is being touched

例如:

//将背景色改为透明

_historyPropertyTableView.sectionIndexBackgroundColor = [UIColor clearColor];

上一篇 下一篇

猜你喜欢

热点阅读