有没有办法在不调用的情况下重新加载表视图的节页眉/页脚[tableView reloadData];
?
事实上,我想在表视图的部分页脚中显示表格视图部分中的单元格数量。表视图是可编辑的,我使用删除或插入行
– insertRowsAtIndexPaths:withRowAnimation:
– deleteRowsAtIndexPaths:withRowAnimation:
这些方法似乎不会更新节页脚。奇怪的是,当我调用这些方法时表视图数据源方法
- (NSString *)tableView:(UITableView *)table titleForFooterInSection:(NSInteger)section
被调用(两次!),但它不会用新值更新表视图!
有人知道如何解决这个问题吗?
如果您只有基本的文本页眉或页脚,则可以直接访问它们:
[tableView footerViewForSection:indexPath.section].textLabel.text = [self tableView:tableView titleForFooterInSection:indexPath.section];
与标题类似:
[tableView headerViewForSection:indexPath.section].textLabel.text = [self tableView:tableView titleForHeaderInSection:indexPath.section];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)