UITableView titleForHeaderInSection shows all caps

前端 未结 14 953
孤独总比滥情好
孤独总比滥情好 2021-01-30 16:28

I am using titleForHeaderInSection to show a header for a UITableView section. It worked fine with the iOS6 SDK, but the iOS7 SDK shows the header in all CAPS.

I guess

14条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 17:03

    Simplest Solution for was below: Swift 2.x

    func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
    
            header.textLabel?.text = header.textLabel?.text?.capitalizedString
    }
    

提交回复
热议问题