2016-11-09 47 views
0

工作,我有一个UICollectionView中,我想一个UIRefreshControl为了使用户能够向下滑动即可刷新集成。迅速3 - UIRefreshControl不是在大屏幕

说我在我的UICollectionView中有5个项目。如果我在iPhone5中运行我的应用程序,那么UIRefreshControl工作得很好。但是,如果我在iPhone6Plus(其中所有5个项目都适合屏幕)中运行它,那么UIRefreshControl就不再适用了;我甚至无法将其滑倒。

是否有UIRefreshControl的任何属性,可以帮助用户向下滑动,在任何情况下,无论屏幕是什么尺寸?我接过来看看下面UIRefreshControl类,但似乎这些都不能帮助:

public init() 


open var isRefreshing: Bool { get } 


open var tintColor: UIColor! 

open var attributedTitle: NSAttributedString? 


// May be used to indicate to the refreshControl that an external event has initiated the refresh action 
@available(iOS 6.0, *) 
open func beginRefreshing() 

// Must be explicitly called when the refreshing has completed 
@available(iOS 6.0, *) 
open func endRefreshing() 

的丑陋的解决方案是让一个刷新按钮,这是我不想要的。

您有什么想法吗?

在此先感谢

回答

3

那是因为你的CollectionView的contentSize不够大滚动。 (它比你的屏幕尺寸小)。

UIRefreshControl只在您的scrollView可滚动时才起作用。

如果您想让您的UICollectionView始终滚动。

alwaysBounceVertical属性设置为true。 (这是由UIScrollView继承)

+0

非常感谢,约翰尼。有用! – quanguyen