Change color of alternate row in UITableView


- (void)tableView: (UITableView*)tableView willDisplayCell: (UITableViewCell*)cell forRowAtIndexPath: (NSIndexPath*)indexPath
{

if(indexPath.row % 2 == 0)
cell.backgroundColor = [UIColor redColor];
else
cell.backgroundColor = [UIColor whiteColor];
}
Previous
Next Post »

ConversionConversion EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng