简体   繁体   中英

Change UITableViewController background color under the table

I'am trying to change the color under the UITableViewController's cells but I can't do it. (gray section on screenshot after the swipe down of table) 在此处输入图片说明

I tried with:

self.tableView.backgroundColor = UIColor.red 

and:

self.tableView.tableFooterView?.backgroundColor = UIColor.red

I don't find any options on storyboard Could you help me?

you have to set tableview background view first to change tableview backgroundcolor.

let view = UIView()
view.frame = self.tableView.frame
view.backgroundColor = UIColor.red
self.tableView.backgroundView = view

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM