ios - UIRefreshControl 在 Collection View 中不起作用

标签 ios objective-c uicollectionview uirefreshcontrol

我已将 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/

相关文章:

ios - 可观察的 distinctUntilChanged 返回重复项

javascript - 平板电脑/ipad 的 window.onzoom 事件?

ios SWRevealViewController 显示推送 segue 动画

objective-c - 如何在NSBrowser中向前和向后遍历?

swift - 如何在 Swift 中为 UICollectionViewCell 制作动画?

ios - UIButton setEnabled 不起作用

ios 7 半透明+彩色导航栏

objective-c - 无法将表达式的类型 'Void' 转换为类型 'String!'

ios - swift 从 UICollectionViewDataSource 继承时的通用类

ios - 如何缓存 UIViewControllers 以供 UICollectionViewCell 使用?