BackgroundColor of UITableViewCellStyleSubtitle labels ??!?
Posted
by P5ycH0
on Stack Overflow
See other posts from Stack Overflow
or by P5ycH0
Published on 2010-01-05T09:24:25Z
Indexed on
2010/04/20
0:43 UTC
Read the original article
Hit count: 508
I am trying to create a table with an image as a background. To achieve this, I started out with the background:
self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
This resulted in a background image which appears in tablecells as well. That is not something I want, so I tried to set the cell's backgroundColor:
cell.backgroundColor = [UIColor whiteColor];
This had no effect at all !!!. Hmmm strange. So I tried this:
UIView *backgroundView = [[UIView alloc] init];
backgroundView.backgroundColor = [UIColor whiteColor];
cell.backgroundView = backgroundView;
[backgroundView release];
This works almost. The only problem left is that the textLabel & the detailTextLabel still show the background behind them. Setting the backgroundColor on those labels to white doesn't do anything either.
How do I proceed? Where do I go wrong? I am trying to achieve a tableView like the worldClock app has.
© Stack Overflow or respective owner