I've set the image for the cells in my table view but the lines dividing the cells aren't showing. What have I done wrong?
I can see the separator lines if I un-comment
I also logged the separator style and color
2013-05-19 21:38:21.103 KFBNewsroom[2593:c07] cell separator style: 2 separator color: UIDeviceRGBColorSpace 0.67 0.67 0.67 1
2013-05-19 21:38:21.104 KFBNewsroom[2593:c07] cell separator style: 2 separator color: UIDeviceRGBColorSpace 0.67 0.67 0.67 1
2013-05-19 21:38:21.105 KFBNewsroom[2593:c07] cell separator style: 2 separator color: UIDeviceRGBColorSpace 0.67 0.67 0.67 1
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *mbTableIdentifier = @"SimpleTableItem";
UIImageView *image = [[UIImageView alloc]init];
image.image = [UIImage imageNamed:@"BarButton.png"];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:mbTableIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:mbTableIdentifier];
cell.textLabel.font=[UIFont systemFontOfSize:16.0];
}
// cell.backgroundView = [[CustomCellBackground alloc] init];
cell.selectedBackgroundView = [[CustomCellBackground alloc] init];
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.textLabel.highlightedTextColor = [UIColor darkGrayColor];
cell.textLabel.textColor = [UIColor whiteColor];
cell.backgroundView = image;
cell.textLabel.text = [mbTableData objectAtIndex:indexPath.row];
return cell;
}
I can see the separator lines if I un-comment
Code:
cell.backgroundView = [[CustomCellBackground alloc] init];
I also logged the separator style and color
2013-05-19 21:38:21.103 KFBNewsroom[2593:c07] cell separator style: 2 separator color: UIDeviceRGBColorSpace 0.67 0.67 0.67 1
2013-05-19 21:38:21.104 KFBNewsroom[2593:c07] cell separator style: 2 separator color: UIDeviceRGBColorSpace 0.67 0.67 0.67 1
2013-05-19 21:38:21.105 KFBNewsroom[2593:c07] cell separator style: 2 separator color: UIDeviceRGBColorSpace 0.67 0.67 0.67 1