动态heightForHeaderInSection

pas*_*ine 5 height header uitableview

如何根据我添加的视图修改标题部分的高度?
heightForHeaderInSection以前调用viewForHeaderInSection,我不知道视图大小,直到我创建它.

Abh*_*ngh 12

你可以这样说:

  1. 为headerView创建一个属性(如果有多个标题视图,则为NSArray).
  2. 在" heightForHeaderInSection"中创建视图.
  3. 将视图分配给属性.
  4. 在" heightForHeaderInSection"中返回视图的高度.
  5. 在"viewForHeaderInSection"中返回此属性.