Update section footer title in UITableView without reloading
I know I'm late to this thread, but I've found you can simply do this:
[self.tableView beginUpdates];
[self.tableView footerViewForSection:section].textLabel.text = @"Whatever";
[[self.tableView footerViewForSection:section].textLabel sizeToFit];
[self.tableView endUpdates];
If you have groupped table, you can use:
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
yourLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 17)]; //I'm not sure about the frame...
yourLabel.font = [UIFont systemFontOfSize:16];
yourLabel.shadowColor = [UIColor whiteColor];
yourLabel.shadowOffset = CGSizeMake(0, 1);
yourLabel.textAlignment = UITextAlignmentCenter;
yourLabel.textColor = RGB(76, 86, 108);
yourLabel.backgroundColor = [UIColor clearColor];
yourLabel.opaque = NO;
return yourLabel;
}
Declare yourLabel
in your .h
file. Then, you can access it via
yourLabel.text = @"whatever you want";
Please check if that works :)
For first section (ziro)
[self.tableView footerViewForSection:0].textLabel.text = @"test";