1.获取CollectionView当前显示的Cell.
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
// 将collectionView在控制器view的中心点转化成collectionView上的坐标
CGPoint pInView = [self.view convertPoint:self.collectionView.center toView:self.collectionView];
// 获取这一点的indexPath
NSIndexPath *indexPathNow = [self.collectionView indexPathForItemAtPoint:pInView];
// 赋值给记录当前坐标的变量
self.currentIndexPath = indexPathNow;
// 更新底部的数据
// ...
}
https://blog.csdn.net/happyshaotang2/article/details/78978554
网友评论