简体   繁体   中英

How to change UITableviewController Static cell section background color change using Swift?

My Scenario, I am trying to change the UITableviewController static cell header background color by using below code. I checked cell color, content view color clear and fixed tableview background color black, but section color not changing. How to fix it?

 self.tableView.backgroundColor =  .black
 self.mycell.backgroundColor =  .clear

In your UITableViewDelegate override the following to modify header view:

override func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
    view.tintColor = .green
}

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