简体   繁体   English

RxSwift TableView - 如何设置 numberOfRowsInSection?

[英]RxSwift TableView - How to set numberOfRowsInSection?

Using RxSwift, is there an equivalent to numberOfRowsInSection?使用 RxSwift,是否有等效于 numberOfRowsInSection 的方法? It seems like Rx automatically sets the amount of rows based on the data, but I need to add an additional unique cell at the end of the tableview that doesn't relate to the data.看起来 Rx 会根据数据自动设置行数,但我需要在 tableview 的末尾添加一个与数据无关的额外唯一单元格。 Since the tableView returns automatically once it's gone through all the data, I can't set that cell.由于 tableView 在遍历所有数据后会自动返回,因此我无法设置该单元格。 Thanks!谢谢!

You should make UI manipulations through your data.您应该通过数据进行 UI 操作。 Anyway, I suggest checking out RxDataSources : https://github.com/RxSwiftCommunity/RxDataSources无论如何,我建议查看RxDataSourceshttps://github.com/RxSwiftCommunity/RxDataSources

Also please check out this question: RxSwift table view with multiple custom cell types另请查看这个问题: RxSwift table view with multiple custom cell types

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM