我已将 UIRefreshControl
添加到我的 Collection View 中:
self.refreshControl = [[UIRefreshControl alloc]init];
[self.refreshControl addTarget:self action:@selector(refreshCV:) forControlEvents:UIControlEventValueChanged];
[self.collectionView addSubview:self.refreshControl];
- (void)refreshCV:(UIRefreshControl *)refresh{
NSLog(@"Refresh");
[refresh endRefreshing];
}
但它并不总是有效。也就是说,有时候下拉的时候并没有调用刷新函数。如何解决?
最佳答案
试试这个 answer .
您必须设置 Collection View 的 alwaysBounceVertical
属性。
关于ios - UIRefreshControl 在 Collection View 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36593568/