I am working on a project, it has a number of images displayed as a collection of web data.
I implemented a collection view of the WaterFlowLayout Github Open Source Project https://github.com/aceisScope/WaterflowView
Images are dynamically assigned to an array of collection images.
It works fine if the collection view source has 3 or more images.
But if the number of images to display is less than 3, than it is not displayed as a collection. In the demo project, the same thing happens.
one more thing that I implemented for updating, but inside and almost 12 images can be displayed on one page, and if the number of images is more than 13 than the default scroll for the collection, it works fine and can be pulled out to update, but if the image count is less than 12 than I cannot access to update the colletion view.
if numberOfItemsInSection is 3, and numberOfColumnsInFlowLayout is also 3 means that it completed one full row, than the code will work fine.
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return 3; } #pragma mark- UICollectionViewDatasourceFlowLayout - (NSInteger)numberOfColumnsInFlowLayout:(WaterFlowLayout*)flowlayout { return 3; }
but if numberOfItemsInSection is 2, and numberOfColumnsInFlowLayout is also 3, then it doesnβt complete one full line, I canβt display the images.
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return 2; } #pragma mark- UICollectionViewDatasourceFlowLayout - (NSInteger)numberOfColumnsInFlowLayout:(WaterFlowLayout*)flowlayout { return 3; }
and can someone also suggest some trick to enable pull to update even if the default scroll of the sort is not active.
Thanks in advance...