I need to reduce the space between two sections ofUITableView
. I looked at this question but the solution doesn't allow for my custom header view because it combines the space of the footer and header.
Here is a picture of the UITableView
. The black color is the UITableView
background color.
You need to use method heightForHeaderInSection for defining space between header & cell text. You can also change it depending on different sections for eg. at some sections you may need to show more distance & under some, you don't want to show gap. For such case you can use CGFLOAT_MIN which is 0.000001f. Giving you an example, how you can use different section with different header heights
Hope it will help you.
You can do it by implement the delegate
heightForHeaderInSection
&heightForFooterInSection
.The return vaule should not be 0, even if the SectionHeader or the height of SectionFooter is 0, it need a very small value, try
CGFLOAT_MIN
.for my example:
}