UITableView cell background color

前端 未结 8 800
别那么骄傲
别那么骄傲 2020-12-08 03:13

how to set different background colors for cells in a UITableView (specifically rainbow color for seven cells)

8条回答
  •  被撕碎了的回忆
    2020-12-08 03:38

    If you've subclassed UITableViewCell, you can reliably set self.backgroundColor in -layoutSubviews. At least in my experience, this works in the odd cases where tableView:willDisplayCell:forRowAtIndexPath: does not.

提交回复
热议问题