Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UITableView自定义页脚消失_Ios_Uitableview - Fatal编程技术网

Ios UITableView自定义页脚消失

Ios UITableView自定义页脚消失,ios,uitableview,Ios,Uitableview,我使用了自定义UITableView页脚,它工作正常,但当我在heightForRowAtIndexPath中更改单元格高度时,页脚就消失了 编辑: 我在这里创建页脚 -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { actStreamFooter = [[[NSBundle mainBundle]loadNibNamed:@"AcvitityStreamFo

我使用了自定义UITableView页脚,它工作正常,但当我在heightForRowAtIndexPath中更改单元格高度时,页脚就消失了

编辑:

我在这里创建页脚

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    actStreamFooter = [[[NSBundle mainBundle]loadNibNamed:@"AcvitityStreamFooter" owner:self options:nil]objectAtIndex:0];
    footerHeight = actStreamFooter.frame.size.height;

    UIButton *taptoLoad = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, actStreamFooter.frame.size.width, actStreamFooter.frame.size.height)];
    [taptoLoad addTarget:self action:@selector(tapToLoad) forControlEvents:UIControlEventTouchUpInside];
    [actStreamFooter addSubview:taptoLoad];

    if (section == 1) {
        return actStreamFooter;
    }
    else{
        return nil;
    }
}
那么当我打电话的时候

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
因为我需要更新行,因为每个单元格内都有一个展开视图


更改高度后,页脚消失,我尝试了
[tableView reloadData]
它可以工作页脚不会消失,但在重新加载时会闪烁一个小故障。我想消除这个问题,需要为每个部分初始化并返回一个新的页脚。
ui视图
不能多次出现在视图继承权中

你到底在哪里设置页脚?我编辑了这个问题。你是直接用你的代码调用
heightforrowatinexpath
吗?旁注-将大部分代码移到
if
语句中。如果您只需要在一个部分中使用这些代码,为什么要为每个部分运行所有这些代码?