iphone - 刷新 didSelectRowAtIndexPath 委托(delegate)上的 viewForFooterInSection

标签 iphone uitableview footer

我在不同部分中显示 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/

相关文章:

php - 在 PHP 中从 ipa 中提取嵌入式配置文件

ios - TableView 上的 EXC_BAD_ACCESS (SIGSEGV) :cellForRowAtIndexPath

ios - 自定义 CollectionViewCell 在选择时具有默认值

iphone - 如何向 View 添加页脚?

css - 设置位置时网页页脚出现问题

html - 具有调整大小问题 css 的页脚

iphone - iPad中矩形的发光效果

iphone - 是否可以在 UIView 层中播放电影文件?

iphone - 如何为本地化应用程序加载 XIB?

iOS:如何在不使用第三方库或 pod 的情况下在 Swift 中创建可扩展的 TableView