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