UIRefreshControl for "Pull Up" to update?

How to add a UIRefreshControl at the bottom of a UIColloectionView? Does this mean how it works when it comes to scrolling up (to see old data or something else)?

+6
source share
3 answers

Here is the CCBottomRefreshControl category for the UIScrollView class (the parent class of the UICollectionView class) that implements the bottomRefreshControl property. It is compatible with both iOS 6 and 7 update controls.

+4
source

You cannot use UIRefreshControl for this, but if you are fine with a simpler solution, you can simply adjust the collection view to automatically load more data as you scroll down. (By the way, this is a much more common user interface ... pulling up to the update is not common, but it automatically extracts more data when you get to the bottom.)

The most primitive summary of this is to answer the UIScrollViewDelegate method and determine if you scroll at the bottom of the collection view (which itself is a subclass of UIScrollView ):

 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { if ((scrollView.contentOffset.y + scrollView.frame.size.height) >= scrollView.contentSize.height) { if (!self.isLoadingMoreData) { self.loadingMoreData = YES; // proceed with the loading of more data } } } 

Even better, if you have more data to upload, show the box at the bottom that says β€œwait, load more data”, possibly using the UIActivityIndicatorView . For example, if you have more data to load, add a section to the end with this single cell. If you format this extra cell correctly (for example, one cell that goes all the way through the collection view), it can definitely have the effect you're looking for.

+9
source

You can not. You cannot configure UIRefreshControl .

-2
source

All Articles