UICollectionView UIRefreshControl 在访问不同的视图后不动画 [英] UICollectionView UIRefreshControl Doesn't Animate After Visiting a Different View

查看:26
本文介绍了UICollectionView UIRefreshControl 在访问不同的视图后不动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个连接到 UICollection 的 UIRefreshControl,该 UICollection 以这种方式定义用于下拉刷新:

I have a UIRefreshControl connected to a UICollection that is defined this way for pull to refresh:

    self.refreshControl = [[UIRefreshControl alloc] init];
    [self.refreshControl addTarget:self action:@selector(startRefresh:)
    self.collectionView.alwaysBounceVertical = YES;
    [self.collectionView addSubview:self.refreshControl];

这很好用.但是,每当我通过推送新视图控制器或显示滑动侧边栏菜单移动到新视图并返回此视图时,刷新控件开始显示一直拉动的控件的图像(即它没有动画并显示完整的圆圈).但是,如果我完全下拉并释放,刷新控制将恢复正常功能.控件工作正常,在导航到其他地方后第一次拉动时它看起来很时髦.

This works fine. However, whenever I move to a new view by either pushing a new view controller or displaying the sliding sidebar menu, and return to this view, the refresh control starts displaying the image for a control pulled all the way (i.e. it doesn't animate and shows the full circle). However, if I pull down fully and release, the refresh control returns to normal functionality. The control works fine, it just looks funky the first time you pull after navigating elsewhere.

我希望收到有关可能出现问题的任何反馈.谢谢!

I would love any feedback on what might be going wrong. Thanks!

这是不工作时图像的样子(请注意,我正在链接到在线图像,这不是来自我的应用程序,因此这并不表明正在下拉集合视图):

This is what the image looks like when not working (note I am linking to an online image, this is not from my app so this doesn't show that the collectionview is being pulled down):

下面发布的解决方案有效,但我必须做一些额外的工作才能弄清楚我的顶视图控制器何时从我使用的侧边栏菜单(ECSlidingViewController)获得焦点:有没有办法让 ECSlidingViewController 中的顶视图控制器知道侧边栏何时出现菜单已关闭?

Posted solution below worked, but I had to do some extra work to figure out when my top view controller received focus from the sidebar menu that I was using (ECSlidingViewController): Is there a way for the Top View Controller in ECSlidingViewController to know when the sidebar menu has been dismissed?

推荐答案

加载完成后必须停止刷新

After completed loading You have to stop the refreshing

[tableView.refreshControl endRefreshing]

希望对你有用..:)

这篇关于UICollectionView UIRefreshControl 在访问不同的视图后不动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆