I am using UICollectionView first time in my iPad application. I set the UICollectionView so that the cell size and size are the same, which means the cell is displayed immediately.
Problem: Now that the user scrolls through the UICollectionView, I need to know which cell is visible, I need to update other user interface elements when changing. For this, I did not find any delegate method. How can I achieve this?
The code:
[self.mainImageCollection setTag:MAIN_IMAGE_COLLECTION_VIEW]; [self.mainImageCollection registerClass:[InspirationMainImageCollectionCell class] forCellWithReuseIdentifier:@"cellIdentifier"]; [self.mainImageFlowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal]; [self.mainImageFlowLayout setMinimumInteritemSpacing:0.0f]; [self.mainImageFlowLayout setMinimumLineSpacing:0.0f]; self.mainImageFlowLayout.minimumLineSpacing = 0; [self.mainImageCollection setPagingEnabled:YES]; [self.mainImageCollection setShowsHorizontalScrollIndicator:NO]; [self.mainImageCollection setCollectionViewLayout:self.mainImageFlowLayout];
What I tried:
How UICollectionView Matches UIScrollView I got when custom scrolling ends using the UIScrollViewDelegate method
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
But inside the function above, how can I get the current visible index of a UICollectionView cell ???
ios objective-c ipad uicollectionview
Irfan DANISH Sep 06 '13 at 4:30 2013-09-06 04:30
source share