2016-11-09 72 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