How to change the cell title color when selected in UITableView
HI, I am using a UITableView to display listings. I have customized it and have added 4 UILabels in the cell, but when the row is selected then the row s开发者_开发技巧election color (customized to green) and Label text color (also a green) remains same. So, it becomes difficult to see the text of cell. I want to change the color of labels to white when row is selected otherwise green.
Can anyone help me out?
Thanks,
Look at the highlightedTextColor
property on the labels. Set that to white and it should do what you want.
If you’re subclassing UITableViewCell
, there’s always the -setSelected:animated:
method to override.
精彩评论