How to hide a section in UITableView?

前端 未结 12 2186
梦如初夏
梦如初夏 2020-12-05 00:32

There are some section in the table that does not contain any data and would like to hide that section.

How to do this?

12条回答
  •  北海茫月
    2020-12-05 00:59

    It is true that 0 is not a valid height for headers and footers. However, the heights are CGFloat values. You can specify a very small number (I've used 0.1) for the height of the section headers and footers.

    Kind of a hack, but it works.

提交回复
热议问题