Tar*_*riq 5 iphone footer uitableview
我在不同的部分显示UITableViewCell上的项目列表.我在viewForFooterInSection委托中创建了UITextField
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
Run Code Online (Sandbox Code Playgroud)
现在我的问题是我不想每次都显示viewForFooterInSection.它应该是nil/hidden,直到我单击该特定部分的didSelectRowAtIndexPath.并且UITextField应仅显示该部分.
我很困惑如何在点击时重新加载footerView?
您只需重新加载该部分即可重新加载页脚视图.
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationNone];
Run Code Online (Sandbox Code Playgroud)
在此调用之后,- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section再次命中,您可以保留一个布尔变量,并相应地返回nil或您的页脚视图.
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
if(conditionSatisfied)
return myFooterView;
return nil;
}
Run Code Online (Sandbox Code Playgroud)
HTH,
阿克沙伊
| 归档时间: |
|
| 查看次数: |
9850 次 |
| 最近记录: |