Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

selection color for a UITableViewCell

If I have a custom UITableViewCell that doesn't use the textLabel built in to the cell but instead does its own drawing, how can I change the appearance of the contentView on selection, like it does automatically for the default text (customizable by setting the selectedTextColor:)?

If I change tableView:willSelectRowAtIndexPath:, then it only updates after the blue selection background is up, but not while it's animating, like I want.

like image 754
Sophie Alpert Avatar asked Apr 08 '26 09:04

Sophie Alpert


1 Answers

Just don't subclass UITableViewCell and use the default behavior. You can fully customize a cell without any subclassing.

Read this article for more details.

like image 53
Thomas Avatar answered Apr 10 '26 21:04

Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!