UICollectionView加载更多数据 [英] UICollectionView load more data
本文介绍了UICollectionView加载更多数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果最后一个单元格显示,我想从服务器获取更多数据,但是UICollectionView没有像UITableview那样的方法-willDisplayCell。所以我不知道这种情况,有人可以告诉我该怎么办,谢谢!
I want to fetch more data from server if the last cell will display, but UICollectionView don't have method -willDisplayCell like UITableview. So I have no idea about this situation, can somebody tell me what should I do , thanks!
推荐答案
你可以简单地实现内部获取操作 -
You can simply implement the fetching operation inside -
(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
并检查条件
if(indexPath.row==your_array.count-1).
这篇关于UICollectionView加载更多数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文