Changing UITableViewCell textLabel background color to clear
Posted
by SorinA.
on Stack Overflow
See other posts from Stack Overflow
or by SorinA.
Published on 2009-07-22T10:49:06Z
Indexed on
2010/04/15
7:43 UTC
Read the original article
Hit count: 535
In my app i have a table view with customViewCells. i subclassed the UITableViewCell class and added an image that will load async and for the text i use cell.textLabel.text = @"someThext".
for the cells the background color is set alternatively to [UIColor darkGrayColor] and whitecolor.
When i run the app in the simulator and on the pone the textLabel of the cell has the background white. I want to set it to be clear, because i want the background color of the cell to be full not a strip then white then another strip.
in the init method of my custom cell i added hoping that the white will turn into red but it doesn't have any effect.
[self.textLabel setBackgroundColor:[UIColor redColor]];
i tried also
self.textLabel.backgroundColor = [UIColor redColor];
but this also didn't work...if i add a UILabel as a subview the background color of the label can be set..but i don't want to do that because when i rotate the phone i want my labels to auto enlarge...
any ideas why setting the background color of cell.textLabel doesn't work?
thank you
© Stack Overflow or respective owner