iPhone SDK: Transparent tableviewcell isn't transparent?

Posted by Harkonian on Stack Overflow See other posts from Stack Overflow or by Harkonian
Published on 2010-01-28T17:21:10Z Indexed on 2010/03/25 7:03 UTC
Read the original article Hit count: 620

I have a UITableViewController that has a background image. I am setting the image for the tableview like this:

[self.view setBackgroundColor: [UIColor colorWithPatternImage:
[UIImage imageWithContentsOfFile:
[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:
@"background1.jpg"]]]];

The problem is, each of my custom tableview cells get the same background image--it's repeated in each cell. As a test, I tried making everything in my cell transparent with an alpha of 0.0, but even then although I can't see any of the labels in each cell, I still see the background image repeated in each cell:

cell.backgroundColor = [UIColor clearColor];
cell.contentView.backgroundColor = [UIColor clearColor];
cell.contentView.alpha = 0.0;
cell.alpha = 0.0;

Any suggestions on how to get my table's background image to stop repeating in each cell would be appreciated!

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about transparency