I have a custom UITableViewCell
with a UILabel
and a UITextView
in it.
I want the text for both of these to appear white when the
The solution posted by the author is half right for my situation. Need to keep in mind that the following events happen:
Knowing this, and depending on how you want the TableCell to look when highighted vs when selected will determine if you need to implement setHighlighted:animated:, setSelected:animated: or both methods.
For the look I want, I need to implement both methods.
Found it and it was a lot easier than I thought. Just need to use the UITableViewCell
setHighlighted
method.
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
[super setHighlighted:highlighted animated:animated];
if (highlighted) {
[self.myTextView setTextColor:[UIColor whiteColor]];
} else {
[self.myTextView setTextColor:[UIColor blackColor]];
}
}