iOS Swift - How to change background color of Table View?

前端 未结 6 1496
情书的邮戳
情书的邮戳 2021-01-31 02:46

I have a simple table view, I can change the colors of cells, but when trying to change the color of Table View (Background part) it is not working... I tried it via Storyboard.

6条回答
  •  粉色の甜心
    2021-01-31 03:28

    You have:

    1. Cell background AND
    2. Cell ContentView

    Put ContentView like Default (transparent) in SB, and in your Cell's Method in awakeFromNib, just:

    self.backgroundColor = UIColor.SomeColor
    

提交回复
热议问题