您的位置:首页 > 其它

修改tableView侧栏索引的背景色

2016-03-31 15:53 309 查看
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];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: