0
在我的项目中,我使用sectionIndexTitlesForTableView方法设置了索引。但我无法设置索引的字体大小。任何人都可以告诉我如何设置它的大小?如何更改UITableView中索引的字体大小
在我的项目中,我使用sectionIndexTitlesForTableView方法设置了索引。但我无法设置索引的字体大小。任何人都可以告诉我如何设置它的大小?如何更改UITableView中索引的字体大小
如果我明白你的问题吧,试试下面的代码:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UILabel *testLabel = [[UILabel alloc] init];
testLabel.frame = CGRectMake(20, 8, 320, 20);
testLabel.font = [UIFont boldSystemFontOfSize:18];
testLabel.text = [self tableView:tableView titleForHeaderInSection:section];
UIView *headerView = [[UIView alloc] init];
[headerView addSubview:testLabel];
return headerView;
}
我只是觉得在GitHub上一项伟大的工程,高度可定制的。 MJNIndexView 我希望它能帮助你。
您给出的代码是段落标题,但是我想要索引代码,那就是表格右侧的字母列表。 – Sami