Friday, February 25, 2011

Set Background Image of Cell Example

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *backgroundPath = [[NSBundle mainBundle] pathForResource:@"CellBg" ofType:@"png"];
UIImage *backgroundImage = [UIImage imageWithContentsOfFile:backgroundPath];
[cell setBackgroundColor:[UIColor colorWithPatternImage:backgroundImage]];

}

No comments:

Post a Comment