簡體   English   中英

使用AsyncDisplayKit時如何添加節的頁眉/頁腳視圖?

[英]How to add section header/footer view when using AsyncDisplayKit?

似乎當前ASTableNodeASTableView都缺少節頁眉/頁腳視圖的支持。

我不僅找到一種協議方法:

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

什么也沒顯示。

而且委托/數據源設置方法已被AsyncDisplayKit攔截,因此我無法使用UIKit的方法來實現。

那么在使用AsyncDisplayKit時可以添加節的頁眉/頁腳視圖嗎?

只需發現ASTableNode將調用UITableViewDelegate方法即可。

所以只需實施方法

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

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

它會像以前一樣工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM