Reputation: 21760
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.
Upvotes: 0
Views: 1748
Reputation: 21760
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.
Upvotes: 2
Reputation: 58448
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:
Upvotes: 0
Reputation: 59689
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..
Upvotes: 1