To amend the header section display in terms of colours for example on a uitableview you can utilise the UITableView Delegate protocol of tableView:willDisplayHeaderView:forSection:
You can alter the background colour using the view tintColor and then by accessing the view you can amend the header text label.
1 2 3 4 5 6 7 8 |
override func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) { view.tintColor = UIColor.redColor() let headerView: UITableViewHeaderFooterView = view as! UITableViewHeaderFooterView headerView.textLabel.textColor = UIColor.whiteColor() } |
You can apply different styles for different section headers using the section parameter making it very easy to amend the display of all headers within your table view.
Please follow and like us: