views:

752

answers:

4

My UITableViewController uses a custom UITableViewCell Subclass.

The subClass (QuoteCell - loaded from NIB) has a few UILabels and a UIImageView on it.

Works fine, however, when I tap on the cell, the cell highlights, but the UILabels on the cell don't reverse colors.

I thought this was stock behavior??

Any help appreciated, Thanks!

btw: There's nothing in the didSelectRowAtIndexPath method yet.

+1  A: 

I wonder why you need to show the row selection?

You could do this

cell.selectionStyle = UITableViewCellSelectionStyleNone;

and handle your row selection logic as-is..

Prakash
A: 

You have to write the code to swap the text colour of the label yourself.

The best place for that would probably be in -setHighlighted:animated:

Jasarien
+1  A: 

I found the answer, after reading comments from Jasarien and Prakash.

Apparently, in IB, you manually have to select a highlight color to see the behavior.

By default, UILabel color is Black and the highlight color apparently is also Black, which is strange because it has that half black, half white diagonal. I would think the behavior would be different.

Anyway, I changed the color to solid white and got the highlighted behavior I was expecting.

Jordan
A: 

I spent a long time searching for this solution. I too have a custom UITableViewCell Subclass. When selected, the default blue gradient highlight was showing up and all the text seems to disappear. Upon closer inspection, the highlight property of all the text labels was set to 0% opacity. So I set the highlight text to be white and 100% opaque, expecting this to solve my problem. It didn't :-|

Any more ideas please?

Greg
So when this happened, the opacity was still at 0% even though you have set it to 100%?
Paul Shapiro