How to decrease spacing between cell title and cell text in UITableView
3 answers
You need to use a method heightForHeaderInSection
to define the space between the title and the text of the cell. You can also change it depending on different sections, for example. in some sections you may need more spacing, and under some, you may not want to show the space. In such a case, you can use CGFLOAT_MIN, which is 0.000001f. By giving an example how you can use a different section with different heading heights
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (section == 0 || section == 2)
{
return 55.0;
}
else
{
return CGFLOAT_MIN;
}
}
Hope this helps you.
0
a source to share