Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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..

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:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top