0

How can I achieve multi-line UILabel inside a UITableView header (not to be confused with view for header in section), with top,left,bottom and right anchors using autolayout programatically ?click here for reference

The grey cells are the table view cells. Above the cells, I need the table view header with the support for multiple lines for both the UILabel [the total area in white background will be the tableview header].

Currently, my UILabel does not go beyond a single line (i have tried setting number of lines property to 0 for multi-line as well).

  • Please check this: https://stackoverflow.com/questions/29462331/is-it-possible-to-obtain-a-dynamic-table-view-section-header-height-using-auto-l – Nexus Apr 24 '22 at 11:55
  • Did t’you tried to set number of lines to 3 or 4. This is maximum number of line. – Ptit Xav Apr 24 '22 at 12:03
  • Please note : I am looking for a solution for tableViewHeader https://developer.apple.com/documentation/uikit/uitableview/1614904-tableheaderview and not a view for header in section. The viewForHeader in section reloads a tableview everytime we scroll up, but that is not the case for tableHeaderView – shinigami69 Apr 25 '22 at 04:30

0 Answers0