views:

838

answers:

3

I have a table view that has alternate colors as background color for cells. In addition to that i have added a disclosure indicator accessory. However, the problem is that the cell background color doesnt seem to apply to the area 'behind' the disclosure indicator. The cell background color seems to truncate before the disclosure indicator appears at the right end of the table cell.

A: 

I have the same problem and it is behind the built-in accessories... Haven't found any way to set it's background color yet..

Daniel K
A: 

i've the exact same problem. Did somebody find a solution to this?

Without the accessory, it looks okay, but with the accessory, the background fails to cover the compelet area

A: 

I had a similar problem. This seems to happen because each row in a table is divided into several parts. So merely changing cell.BackgroundColor isn't going to change the entire rows color.

Try something similar to this.. It worked for me:

UITableViewCell *bgView = [[UITableViewCell alloc] initWithFrame:CGRectZero];
    bgView.backgroundColor=indexPath.row % 2? [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1]: [UIColor whiteColor];
    cell.backgroundView=bgView;
dpigera