How to set the height of table header in UITableView?

前端 未结 17 1436
没有蜡笔的小新
没有蜡笔的小新 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:31

    It works with me only if I set the footer/header of the tableview to nil first:

    self.footer = self.searchTableView.tableFooterView;
    CGRect frame = self.footer.frame;
    frame.size.height = 200;
    self.footer.frame = frame;
    self.searchTableView.tableFooterView = nil;
    self.searchTableView.tableFooterView = self.footer;
    

    Make sure that self.footer is a strong reference to prevent the footer view from being deallocated

提交回复
热议问题