iOS 根据collectionView滑动距离计算出index

 //根据collectionView滑动距离计算出index
    CGPoint p = CGPointMake(scrollView.contentOffset.x + CGRectGetWidth(scrollView.frame) / 2.0, CGRectGetHeight(scrollView.frame) / 2.0);
        NSIndexPath *indexPath =  [self.colloectView indexPathForItemAtPoint:p];

你可能感兴趣的:(iOS 根据collectionView滑动距离计算出index)