I have a uiTableView. I want that each other cell gets another background color. I am trying it like this. But it won’t work. Anybody have a clue?
if(indexPath.row % 2 == 0){
cell.backgroundColor = [UIColor whiteColor];
}else{
cell.backgroundColor = [UIColor blueColor];
}
Kind regards,
Stef
You can use :
cell.contentView.backgroundColorinstead ofcell.backgroundColorinsidetableView:cellForRowAtIndexPath:Or : (from Apple docs)