Reputation: 1867
I have a tableview with custom cells. What I want is to have a footer (like a "loading" indicator") at the bottom of the tableview. I am using this code to add the footer:
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[spinner startAnimating];
spinner.frame = CGRectMake(0, 0, 320, 44);
return spinner;
}
But this makes the footer "float" over the bottom of the tableview and overlaps the bottom of the table:
How can I force the footer to only be visible under the last cell of the table? Like this:
Thanks!
Upvotes: 0
Views: 1205
Reputation: 81
You can do it in the storyboard by dragging a UIView into UITableView, and place your loading indicator there .
From your document outline should looks similar to this
Upvotes: 0
Reputation: 1920
I think you should set tableFooterView instead of setting section footer views.
Upvotes: 1