How to set the height of table header in UITableView?

前端 未结 17 1356
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 22:00

I have gone through Apple docs about UITableView class and delegate reference but couldn\'t find the way to set the table header height explicitly.

I set Table cell

17条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 22:39

    With autolayout you could do something like:

    tableView.sectionHeaderHeight = UITableViewAutomaticDimension
    tableView.estimatedSectionHeaderHeight = 
    

    or if your headers are of different heights, go ahead and implement:

    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
        return 
    }
    

提交回复
热议问题