这不是一个问题,而是解释如何解决这个问题.
首先要意识到的是,它UICollectionView确实继承了UIScrollView- 所以使用滚动视图的内容进行标准查找是最好的解决方案.
这是我要解决的问题:
我有一个UICollectionView在每个细胞中都有不同的项目 - 以及不同类型的细胞.我需要选择一个单元格,以使单元格中的图像效果显示为扩展并占据整个屏幕.我如何进行扩展是另一篇文章.
挑战在于让细胞在屏幕上的位置,以便动画部分具有从哪里开始的参考点.
因此,为了便于获取此信息,请考虑以下代码:
第一点:
UICollectionView *picturesCollectionView;
DrawingCell cell; // -> instanceof UICollectionViewCell with custom items.
// first, get the list of cells that are visible on the screen - you must do this every time
// since the items can change... This is a CRITICAL fact. You do not go through the
// entire list of cells - only those the collectionView indicates are visible. Note
// there …Run Code Online (Sandbox Code Playgroud)