• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting the contentOffset of a UICollectionView during update
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting the contentOffset of a UICollectionView during update


  • Subject: Setting the contentOffset of a UICollectionView during update
  • From: Colas B <email@hidden>
  • Date: Sun, 18 Oct 2015 17:26:07 +0000 (UTC)

I have a collection view, with a custom layout, whose layout is changing when one taps on a cell: the cell becomes bigger. The layout is not a sublass of UIViewCollectionViewFlowLayout but directly of UICollectionViewLayout.
I update the layout with [self.collectionView performBatchUpdates:             ^{[self.tableView reloadItemsAtIndexPaths:indexPathsToUpdate];}                              completion:nil];  (I do implement the methods finalLayoutAttributesForDisappearingItemAtIndexPath: etc.)
The problem is that after the update, the contentOffset is not good anymore: I want the specific cell to be centered, but after the update it is not centered.

I tried to change the offset in the method finalizeCollectionViewUpdates: of my custom layout.I also tried to implement the method - targetContentOffsetForProposedContentOffset:
But the problem is always the same. During the animation, the cells that were not visible and become visible don't appear. They stay as "blank space" and only at the end of the animation they appear, all of a sudden.
So my question is, how to change the contentOffset of a UICollectionView during layout updates?
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Setting the contentOffset of a UICollectionView during update
      • From: Colas B <email@hidden>
References: 
 >Setting the contentOffset of a UICollectionView during update (From: Colas B <email@hidden>)

  • Prev by Date: Best Advice?
  • Next by Date: Re: Best Advice for accessing App Delegate's Managed Object Context
  • Next by thread: Re: Drawing many different strings quickly
  • Index(es):
    • Date
    • Thread