UICollectionView setLayout:animated: not preserving zIndex

前端 未结 7 1998
既然无缘
既然无缘 2021-02-01 20:12

I\'ve noticed that when calling setLayout:animated in a UICollectionView to switch between two layouts, the currently visible cell doesn\'t adhere to t

7条回答
  •  臣服心动
    2021-02-01 20:42

    Try setting the z-index in:

    - (UICollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath;
    - (UICollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingItemAtIndexPath:(NSIndexPath *)itemIndexPath;
    

提交回复
热议问题