【问题标题】:How to add section header/footer view when using AsyncDisplayKit?使用 AsyncDisplayKit 时如何添加部分页眉/页脚视图?
【发布时间】:2017-03-24 10:44:24
【问题描述】:

目前ASTableNodeASTableView似乎都缺乏section header/footer view的支持。

我不能只找到一个协议方法:

- (nullable NSString *)tableNode:(ASTableNode *)tableNode titleForHeaderInSection:(NSInteger)section

什么都不显示。

并且delegate/dataSource setter方法已经被AsyncDisplayKit拦截了,所以我不能使用UIKit的方式来做。

那么我可以在使用 AsyncDisplayKit 时添加部分页眉/页脚视图吗?

【问题讨论】:

    标签: ios uitableview sectionheader asyncdisplaykit


    【解决方案1】:

    只要发现ASTableNode 将调用UITableViewDelegate 方法。

    所以只需实现方法

    - (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;
    
    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
    

    它会像以前一样工作。

    【讨论】:

      猜你喜欢
      • 2013-05-07
      • 1970-01-01
      • 2011-02-15
      • 1970-01-01
      • 2019-12-09
      • 1970-01-01
      • 1970-01-01
      • 2011-11-27
      • 2014-05-29
      相关资源
      最近更新 更多