Swift - how to make custom header for UITableView?

后端 未结 7 770
说谎
说谎 2020-12-23 13:57

I need to add custom header to my table

I try this

func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {

    l         


        
7条回答
  •  萌比男神i
    2020-12-23 14:16

    add label to subview of custom view, no need of self.view.addSubview(view), because viewForHeaderInSection return the UIView

    view.addSubview(label)
    

提交回复
热议问题