【问题标题】:The contentSize of the tableView is incorrect after I setting the height of footer设置页脚高度后tableView的contentSize不正确
【发布时间】:2016-11-20 12:55:40
【问题描述】:

我在这里设置部分页脚的高度。

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
NSDictionary *dic = _dataArr[section];
return [YhtCellAdapter adapterHeightOfFooter:[dic[@"type"] integerValue]];}

1:如果我将高度设置为0.01f,空格就会消失。为什么我设置高度后tableView的contentSize不正确?

2:如果我将UITableViewStyleGrouped 更改为UITableViewStylePlain,空间就消失了。但是页脚会浮在底部,我不知道如何隐藏页脚。

【问题讨论】:

  • 你怎么知道contentSize 有问题?你检查过它的价值吗?
  • 当然,我愿意。如果我不设置页脚的高度,则底部没有空间。

标签: ios footer


【解决方案1】:

设置页脚高度后调用Tableview.layoutIfNeeded()

【讨论】:

    猜你喜欢
    • 2020-12-31
    • 1970-01-01
    • 2013-08-11
    • 1970-01-01
    • 1970-01-01
    • 2014-05-12
    • 1970-01-01
    • 2020-02-15
    • 1970-01-01
    相关资源
    最近更新 更多