美文网首页
iOS 根据collectionView滑动距离计算出index

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

作者: 冰点雨 | 来源:发表于2020-12-25 10:03 被阅读0次
     //根据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

          本文链接:https://www.haomeiwen.com/subject/aksbnktx.html