开发者

How to change color of cell.textLabel.text (cell is a UITableViewCell) after click action

开发者 https://www.devze.com 2023-02-08 10:00 出处:网络
I have a bunch of articles shown as cells. When a user clicks on an article, reads it and goes bac开发者_Go百科k, I want that cell.textlabel.text to change from a dark blue to even a darker blue to in

I have a bunch of articles shown as cells. When a user clicks on an article, reads it and goes bac开发者_Go百科k, I want that cell.textlabel.text to change from a dark blue to even a darker blue to indicate that article has been read. How do I do that?


Example:

if (/* article associated with cell has been read*/) {
    cell.textLabel.textColor = [UIColor colorWithRed:0 green:0 blue:0.8 alpha:1]
}
else {
    cell.textLabel.textColor = [UIColor colorWithRed:0 green:0 blue:0.6 alpha:1]
}
0

精彩评论

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

关注公众号