I set my tabe view to use UITableViewStyleGrouped in IB and the cells look fine, but the section headers still look like they are in UITableViewStylePlain. They are over on the left and position does not not match with cells and they do not scroll when I scroll the cells in the view.
I used
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
return [NSArray arrayWithObjects:@"Cats",@"Area",nil];}
to set section titles.
Cheers,
Grant
Try implementing the – (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section method of the UIDataSource protocol instead.
The
sectionIndexTitlesForTableView:is for the index on the right-hand side of your table.Also, have you implemented – (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section of the UITableViewDelegate ? If so, you may want to try without it.