0

Is there a way to get rid of the collectionView flashing when changing layout? (i.e to change the frame bigger or smaller). Also i have a problem where the offset keep jumping at the last index :/.

Here is my example project, any help would be great!!! https://github.com/kaayr1m/enlarge-collection-view

Karim
  • 415
  • 6
  • 14

1 Answers1

0

Try using

[self.collectionView setCollectionViewLayout:layout animated:NO];

by default UICollectionView animates all the CUD(create/update/delete) operations and layout switch as it redraws the layout. If you want to add your own animation/transition views you can use -

(UICollectionViewTransitionLayout *)collectionView:(UICollectionView
*)collectionView transitionLayoutForOldLayout:(UICollectionViewLayout *)fromLayout newLayout:(UICollectionViewLayout *)toLayout
Anil Kumar
  • 654
  • 1
  • 6
  • 18