我在不同部分中显示 UITableViewCell 上的项目列表。我已经在 viewForFooterInSection 委托(delegate)中创建了 UITextField
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
现在我的问题是我不想每次都显示 viewForFooterInSection。它应该为零/隐藏,直到我单击该特定部分的 didSelectRowAtIndexPath 。 UITextField 应该只显示该部分。
我很困惑如何在点击时重新加载 footerView ?
最佳答案
您只需重新加载该部分即可重新加载页脚 View 。
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationNone];
此调用之后,- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
再次命中,您可以在其中保留 bool 变量并相应地返回 nil 或页脚 View .
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
if(conditionSatisfied)
return myFooterView;
return nil;
}
HTH,
阿克谢
关于iphone - 刷新 didSelectRowAtIndexPath 委托(delegate)上的 viewForFooterInSection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7011179/