开发者

How to change the cell title color when selected in UITableView

开发者 https://www.devze.com 2023-01-06 13:43 出处:网络
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 gr

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消