Gap appears after removing section from Grouped UITableView?

You should set appropriate heights of footer and header of your UITableView Implement following methods in your delegate: (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section For example, for second section you could return 0: (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { if (section == 1) return 0; else return 10; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { if (section == 1) return 0; else return 10; } Hope, this will help you.

You should set appropriate heights of footer and header of your UITableView. Implement following methods in your delegate: - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section For example, for second section you could return 0: - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { if (section == 1) return 0; else return 10; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { if (section == 1) return 0; else return 10; } Hope, this will help you.

Thanks for your advise. However, nothing changed after I added the methods above and after setting the footer and header heights to be 0. – Zhen Sep 14 at 15:12 That works quite well for me.

Try to play with this functions – Nekto Sep 14 at 18:25.

I think you should implement (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { if (self.user. Exists) { return 3; } return 2; }.

I have 3 sections in my table, each section containing at most 1 row. However, the center row, depending on a variable, may or may not be displayed in the tableview. The issue I am facing is that for cases whereby the center cell is not supposed to be displayed, a gap still appears between the first and third sections (as seen below).

How can I get rid of the excess gap after I remove the center cell?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions