0

我有一个UICollectionView其中每个单元格包含一个PFObject. 由于每个对象可能有数百个这样的对象UICollectionView,我不想一次查询所有对象,而是只调用有限的数量,然后在用户滚动到最后时自动调用更多对象(有点像无休止的滚动许多网络应用程序使用)。

PFQuery支持这些类型的呼叫,如果是这样,我将如何能够连续自动呼叫?

谢谢!

4

1 回答 1

1

Perhaps something like this to get you on the right track:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

    float scrollViewHeight = scrollView.frame.size.height;
    float scrollContentSizeHeight = scrollView.contentSize.height;

    else if (scrollView.contentOffset.y <= 0) {
        // then we are at the top
    }
    else if (scrollView.contentOffset.y + scrollViewHeight >= scrollContentSizeHeight) {
        // then we are at the bottom - query new results


    }

}

I don't think you'd have to add anything for it to call as long as your controller is already your collectionView's delegate.

于 2014-04-07T18:53:00.433 回答