How to solve the problem UICollectionView can not pull down to refresh

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/jia12216/article/details/101541617

Recently encountered UICollectionView display screen is not enough data, the results can not meet the pull-down refresh monitoring time is less than the scroll bar to scroll to set up and there is no effect. Use the pull-down refresh display data UITableView normal.
Later degree of your mother find and view the interface documentation UICollectionView. I found UICollectionView alwaysBounceVertical default attribute is NO, when the property is NO, and when the cell height is less than the overall height and the height of the table show the beginning and end of the partition, sliding up and down is prohibited UICollectionView.
I set _collectionView.alwaysBounceVertical = NO;the trigger pull-down can finally pull-down refresh refresh components.
Note: you calculate the total height of the cell to calculate the actual table if the calculated ratio is smaller (a small pixels can also be), you set alwaysBounceVertical property to NO, can pull down to refresh. If your data does not show full screen, you do not want to trigger drop-down brush, be sure to set the table height can not be less than the total height of the cell.

Guess you like

Origin blog.csdn.net/jia12216/article/details/101541617