Grouped table view — section spacing

2019-08-15 04:37发布

In a grouped table view can I control the spacing between two sections?

3条回答
淡お忘
2楼-- · 2019-08-15 04:53

tableView:heightForHeaderInSection: and tableView:heightForFooterInSection:

together these control the space in between sections of a grouped UITableView. You cannot return 0, it will use the default value if you do, so use a small float (0.01) to reduce the space to almost nothing.

查看更多
放荡不羁爱自由
3楼-- · 2019-08-15 05:03

Agree with 'viking'.. If you are still having troubles, I have noticed that if you create the table through IB it automatically creates a table header/footer section. If you go into the measurments(in IB) and decrease/increase the height of each section you will see the spacing between grouped sections change.

查看更多
登录 后发表回答