How to set the height of table header in UITableView?

前端 未结 17 1408
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 22:00

I have gone through Apple docs about UITableView class and delegate reference but couldn\'t find the way to set the table header height explicitly.

I set Table cell

17条回答
  •  星月不相逢
    2020-12-02 22:29

    You can create a UIView with the desired height (the width should be that of the UITableView), and inside it you can place a UIImageView with the picture of the proper dimensions: they won't stretch automatically.

    You can also give margin above and below the inner UIImageView, by giving a higher height to the container view.

    Additionally, you can assign a Translation transform in order to place the image in the middle of its container header view, for example.

提交回复
热议问题