I have a grouped type table view and it looks pretty cool.
But, if I change the background color of the table to black, the titles becomes unclear.
Is it pos
If you just need to change the color or font on the header, use tableView: willDisplayHeaderView: forSection:. Here is an example in swift:
Swift v5:
override public func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
if let view = view as? UITableViewHeaderFooterView {
view.backgroundView?.backgroundColor = UIColor.blue
view.textLabel?.backgroundColor = UIColor.clear
view.textLabel?.textColor = UIColor.white
}
}
Original:
override func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
if let view = view as? UITableViewHeaderFooterView {
view.backgroundView?.backgroundColor = ThemeBlue
view.textLabel.backgroundColor = UIColor.clearColor()
view.textLabel.textColor = UIColor.whiteColor()
}
}