如何使用 RxSwift 向 UICollectionView 添加额外的静态单元格?

问题描述

我有一个 customCell 数组,我当前使用 RxSwift & RxCocoa 在 UICollectionView 中正确显示了它。我想添加一个额外的静态单元格,它应该让用户可以添加一个单元格(即使 customCell 列表中没有元素,该单元格也必须始终存在)。我注册了两个单元格类型:

ticketCollectionList.register(UINib(nibName: "TicketSmallCard",bundle: nil),forCellWithReuseIdentifier: "TicketSmallCard")
ticketCollectionList.register(UINib(nibName: "TicketRequestCard",forCellWithReuseIdentifier: "TicketRequestCard")

我用以下命令填充 customCell (TicketSmallCard) 数组:

@R_502[email protected]()
 .bind(to: ticketCollectionList.rx.items(cellIdentifier: String(describing: TicketSmallCard.self),cellType: TicketSmallCard.self)) { row,element,cell in
    cell.configure(with: element)
 }
 .disposed(by: disposeBag)

我不知道如何添加这个静态单元格。在故事板中,我还添加了对具有正确标识符的第二个单元格的引用。

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)