1

My issues is that I am using the below code to return an images in collection view. ImageArray should return different number of images and claimImageArray should return different number of Images.But it does not work properly .Because it only display one image. Can anyone tell me what I did wrong in this ??

 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
    {
       if (collectionView==beforeParcelCollectionViews)
        {
             return [imageArray count];
        }
        if (collectionView ==  afterParcelCollectionView)
        {
            return [claimImagesArray count];
        }
           return 0;
    }
Nisha Gupta
  • 275
  • 1
  • 14

2 Answers2

2
 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
    {
       if (collectionView==beforeParcelCollectionViews)
       {
         return [imageArray count];
       }
       else if (collectionView ==  afterParcelCollectionView)
       {
         return [claimImagesArray count];
       }
       return 0;
}
Mayank Jain
  • 5,663
  • 7
  • 32
  • 65
2

I experienced the same problem. The following link solved my problem. I think you may set the same flow layout for both collectionView.

Multiple UICollectionView in one controller

Community
  • 1
  • 1
user890207
  • 509
  • 1
  • 6
  • 14