UIColreshView上的UIRefreshControl,高度非常低

时间:2017-11-30 09:43:52

标签: ios objective-c uicollectionview

我在UICollectionView上使用了UIRefreshControl。我用它来为UICollectionView加载更多数据。但是,刷新不是由UICollectionView的高度运行的。

请帮帮我。

1 个答案:

答案 0 :(得分:1)

此实例,您不需要使用@selector。您可以使用UIScrollView的委托。覆盖函数 - (void)scrollViewDidScroll:(UIScrollView *)scrollView

这是我的代码:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if (scrollView.contentOffset.y < -65 && ![refreshControl isRefreshing]) {
        [refreshControl beginRefreshing];
        //do all the work

        [refreshControl endRefreshing];
    }
}