【发布时间】:2016-04-21 11:13:15
【问题描述】:
我有一个视图,其中包含顶部的另一个视图,我用它来显示一些基本信息。它大约占总视图高度的 40%。在该“标题”视图下方,我使用的是可滚动的 UICollectionView。现在我在我的 UICollectionView 中添加了一个 UIRefreshControl,但是刷新永远不会发生,因为用户无法将 UICollectionView 下拉那么远。当我降低顶视图的高度时,它开始工作,因为那时有足够的空间将 collectionview 拉下来。
这是我添加 refreshControl 的方式:
self.matchDetailRefreshControl = UIRefreshControl()
self.matchDetailRefreshControl.addTarget(self, action: #selector(MatchDetailViewController.fetchAll), forControlEvents: .ValueChanged)
self.collectionView!.addSubview(self.matchDetailRefreshControl)
self.collectionView!.alwaysBounceVertical = true
如您所见,UIRefreshControl 没有完全填满,而我的手指已经在屏幕底部。
我该如何解决这个问题?
【问题讨论】:
-
尝试使用这个控件:github.com/samvermette/SVPullToRefresh希望你能得到帮助。
标签: ios swift uicollectionview uirefreshcontrol