If I use following line in iOS 5 + its working perfectly.
cell.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.2];
But this is not working in iOS 4. I also tried following but its not working.
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.2];
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
for (UIView *subview in [cell.contentView subviews]) {
subview.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.2];
}
}
If I set color in willDisplayCell , its showing me black background for cell. How can I set background cell color which will work in both iOS 4 & iOS 5.
Any knid of help is appreciated. Thanks