gpt4 book ai didi

ios - UICollectionView 上的 UIRefreshControl 高度非常低

转载 作者:行者123 更新时间:2023-11-29 11:39:09 25 4
gpt4 key购买 nike

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

请帮帮我。

最佳答案

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

这是我的代码:

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

[refreshControl endRefreshing];
}
}

关于ios - UICollectionView 上的 UIRefreshControl 高度非常低,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47570269/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com