Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

loon3y

macrumors 65816
Original poster
I've been trying to add a background image to my table view cells, so each cell has an image of a brand and when they click on it it'll go to another view controller to show the products of that brand.


but I've been on this for hours now and i can't figure it out heres my code:


Code:
 UIView *cellBackView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
    cellBackView.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"background2.png"]];
    cell.backgroundView = cellBackView;



this code worked on my other tableview (was just trying things out) and it worked only when i scanned an item to add to the tableview. but it did not show up when the app loads, which is what i need.
 
Why not just?:
Code:
cell.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"background2.png"]];
 
Don't you have a XIB for your custom UITableViewCells, or are they standard, if they are, then Dejo has your magic answer
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.