UITableView change header title color

后端 未结 6 626
隐瞒了意图╮
隐瞒了意图╮ 2021-02-13 10:18

I\'m styling the UITableView in InAppSettingsKit and want to change the color of the header title:

\"image

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-13 10:59

    Swift 4 version:

    func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
        guard let headerView = view as? UITableViewHeaderFooterView else { return }
        headerView.textLabel?.textColor = .red // any color
    }
    

提交回复
热议问题