I have a UITableView configured as 'UITableViewStylePlain' with UITableViewCellSeparatorStyleSingleLine for its separator style. The cells have a background color.
The problem is that when you scroll the tableview, once some cells disappear off screen and are brought back, the separator is no longer visible.
The cells are registered with:
[tableView registerNib:nib forCellReuseIdentifier:cellIdentifier];
Cell code:
- (void)customizeMyTable
{
[self.tableView setDataSource:self];
[self.tableView setDelegate:self];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
NSString *cellIdentifier = [MyTableViewCell cellIdentifier];
UINib *nib = [UINib nibWithNibName:cellIdentifier bundle:nil];
[self.tableView registerNib:nib forCellReuseIdentifier:cellIdentifier];
self.tableView.rowHeight = 50;
}
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MyTableViewCell *cell = (MyTableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellID];
[cell configure:someDataForThisRow];
return cell;
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.backgroundColor = [UIColor lightGrayColor];
}
Anyone experience this problem? This seems to happen only on iOS 5, not on iOS 6 Tableviews.