我正在使用带有UICollectionView的UIRefreshControl。刷新工作,但视图不会停留在顶部拉动(就像它对uitableview一样)。有没有办法让这件事变得更有说服力,或者这只是为UITableViewController实现的?
self.refreshControl = [[UIRefreshControl alloc] init];
self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[self.refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
[self.collectionView addSubview:self.refreshControl];
[self.collectionView setAlwaysBounceVertical:YES];
发布于 2016-03-02 13:32:45
对于我来说,只有当我试图在调用.endRefreshing()
之前更新单元格时才会发生这种情况。
因此,要修复需要,首先调用.endRefreshing()
,然后更新单元(reloadData
等)。
https://stackoverflow.com/questions/26618594
复制相似问题