Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

loon3y

macrumors 65816
Original poster
Oct 21, 2011
1,231
126
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.