0
votes

enter image description here

enter image description here

enter image description here

I have a custom view on top(search icon/bell) and tableview(with a tableheaderview) below it. If I provide a section headerview to the tableview, tableview does not respect constraints - tableview takes the full screen height automatically, let be whatever constraints I set. If I remove the section header code it respects all the constraints. Above is the image - even though tableview is set to bottom - it takes full height on display. Custom top view hides below the tableview.

Have implemented heightForHeaderInSection, estimatedHeightForHeaderInSection, viewForHeaderInSection.

Also if I set self.feedTableView.contentInset = insets self.feedTableView.scrollIndicatorInsets = insets // height of top view Tableview works properly.

1

1 Answers

0
votes

Make sure you implemented

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