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

xinevil

macrumors newbie
Original poster
Jul 12, 2008
20
0
Hi,

I have a custom UITableViewCell with two UILabels in it. When I select the tableCell, I want the UILabels textColor to be white, until the selection is done (with [tableView deselectRowAtIndexPath:indexPath animated:YES]).
All of Apples custom cells do the same (look at settings app, contacts app, etc.).
I had a kind-of-solution: use -(void)setSelected:(BOOL)selected animated:(BOOL)animated;
But the problem is the label gets white too late (the cell will become black as soon as you touch it, but the labels will become white as soon as you let go the touch).
Also: where do I make the labels textColor black again, so that it animates from white to black precisely as the cell animates from blue to white?
 

Niiro13

macrumors 68000
Feb 12, 2008
1,719
0
Illinois
Are you talking about the label in a cell turning to white when the background is blue?

If that's the case then you'd use:

PHP:
[label setHighlightedTextColor:[UIColor whiteColor]];
 

xinevil

macrumors newbie
Original poster
Jul 12, 2008
20
0
Are you talking about the label in a cell turning to white when the background is blue?

If that's the case then you'd use:

PHP:
[label setHighlightedTextColor:[UIColor whiteColor]];

Nice thanks :D.
Sometimes it can be sooooo easy :p .
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.