一、下面这句代码要想有作用 在iOS11之前需要适配,两个代理都需要实现

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return UITableViewAutomaticDimension;
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section{
    return 60;
}

 

二、今天又发现heightForRow代理方法也不起作用,猜测跟上面是一个意思,试了一下果然

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return UITableViewAutomaticDimension;
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 60;
}

 

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-01-18
  • 2021-10-21
  • 2021-10-18
猜你喜欢
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-07-14
  • 2021-11-19
相关资源
相似解决方案