gpt4 book ai didi

ios - 如何在 IGListKit 中添加 sectionHeader,如 tableview header

转载 作者:可可西里 更新时间:2023-11-01 00:00:46 26 4
gpt4 key购买 nike

IGListKit 库链接:https://github.com/Instagram/IGListKit

我正在使用 IGListKit 制作不同的截面单元格。我成功地完成了这项任务,但我无法使用 iglistKit 为不同的部分添加标题

最佳答案

从 IGListKit 2.1 开始,考虑以 IG 为前缀的类和协议(protocol)名称。从 3.0 开始删除了此前缀。

在您的部分 Controller 类中,除了从 IGListSectionController 继承(并在 IGListKit 2.x 上实现 IGListSectionType)之外,您还需要实现 IGListSupplementaryViewSource 并设置为您的部分 Controller self.supplementaryViewSource = self

您可能需要查看 IGListKit 官方示例中的类 FeedItemSectionController .

当然,您也可以在单独的实体中实现此协议(protocol),但实际上 IGListKit was not designed for that .我的团队能够通过在部分 Controller 将它的一些数据注入(inject)到这个单独的 IGListSupplementaryViewSource 实现器中的方式中增加一些复杂性来做到这一点。

关于ios - 如何在 IGListKit 中添加 sectionHeader,如 tableview header,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44254506/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com