我有一个连接到 UICollection 的 UIRefreshControl,该 UICollection 是这样定义的,用于拉动刷新:
self.refreshControl = [[UIRefreshControl alloc] init];
[self.refreshControl addTarget:self action:@selector(startRefresh:)
self.collectionView.alwaysBounceVertical = YES;
[self.collectionView addSubview:self.refreshControl];
这很好用。但是,每当我通过插入新 View Controller 或显示滑动侧边栏菜单移动到新 View 并返回到此 View 时,刷新控件就会开始显示一直拉出的控件的图像(即,它不会设置动画)并显示完整的圆圈)。但是,如果我完全下拉并释放,刷新控件将恢复正常功能。该控件工作正常,只是在导航到其他地方后第一次拉动时看起来很时髦。
我希望收到有关可能出现问题的任何反馈。谢谢!
这是图像不工作时的样子(请注意,我链接到在线图像,这不是来 self 的应用程序,因此这不会显示 CollectionView 正在被下拉):
下面发布的解决方案有效,但我必须做一些额外的工作来弄清楚我的顶 View Controller 何时从我正在使用的侧边栏菜单接收焦点(ECSlidingViewController):Is there a way for the Top View Controller in ECSlidingViewController to know when the sidebar menu has been dismissed?
最佳答案
加载完成后必须停止刷新
[tableView.refreshControl endRefreshing]
希望它对你有用......:)
关于ios - UICollectionView UIRefreshControl 在访问不同的 View 后不会动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26007968/