如何设置UITableView
右侧sectionIndex?
答案 0 :(得分:1)
Try this solution, this will definitely help you ->
Step 1) Add this method in your class
- (void)setUITableViewSectionIndexFontSize:(UITableView*)tableView{
//UI the index view
for(UIView *view in [tableView subviews]) {
if([view respondsToSelector:@selector(setIndexColor:)]) {
[view performSelector:@selector(setIndexColor:) withObject:[UIColor grayColor]];
if ([view respondsToSelector:@selector(setFont:)]) {
[view performSelector:@selector(setFont:) withObject:[UIFont systemFontOfSize:20.0]];
[view performSelector:@selector(setBackgroundColor:) withObject:[UIColor blueColor]];
}
}
}
}
Step 2) Now add this line just before [tableView reloadData] line ->
[self setUITableViewSectionIndexFontSize:tableView];
[tableView reloadData];