UITableViewCell going black when selected programmatically

前端 未结 1 824
遇见更好的自我
遇见更好的自我 2020-12-11 06:02

I was wondering why this code would give me black UITableViewCells when I set the selected property ON. If I do that, the content of the cell turns completely black, and I h

相关标签:
1条回答
  • 2020-12-11 06:24

    I was having the same problem and fixed it by moving the cell.selected = YES into tableView:willDisplayCell:forRowAtIndexPath instead.

    I think it might be related to the note at the bottom of the UITableViewCell docs about changes to background color requiring use of tableView:willDisplayCell:forRowAtIndexPath (presumably selected sets the background color).

    0 讨论(0)
提交回复
热议问题