For iOS 8., 7. and iOS 6.1
The easiest method is to set the tableFooterView
property:
1 2 3 4 5 6 7 | - (void)viewDidLoad { [super viewDidLoad]; // This will remove extra separators from tableview self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; } |
Or using Storyboard, drag a View
to the bottom of the Table View
to create a tableFooterView
. Set the frame of the tableFooterView
to have a height of 0
.
For previous versions
You could add this to your TableViewController (this will work for any number of sections):
1 2 3 4 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { // This will create a "invisible" footer return 0.01f; } |
and if it is not enough, add the following code too:
1 2 3 4 5 6 7 | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return [UIView new]; // If you are not using ARC: // return [[UIView new] autorelease]; } |