Is it possible to obtain a dynamic table view section header height using Auto Layout?

后端 未结 8 822
清歌不尽
清歌不尽 2020-11-28 02:36

New in iOS 8, you can obtain 100% dynamic table view cells by simply setting the estimated row height, then layout your elements in the cell using Auto Layout. If the conten

8条回答
  •  伪装坚强ぢ
    2020-11-28 03:34

    This can be accomplished by setting (or returning) the estimatedSectionHeaderHeight on your table view.

    If your section header is overlapping your cells after setting estimatedSectionHeaderHeight, make sure that you're using an estimatedRowHeight as well.

    (I'm adding this answer because the second paragraph contains an answer to an issue that can be found after reading through all of the comments which some might miss.)

提交回复
热议问题