Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8660749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:20:06+00:00 2026-06-12T16:20:06+00:00

I have a subclass of UICollectionViewLayout which places cells in a circle. The layout

  • 0

I have a subclass of UICollectionViewLayout which places cells in a circle. The layout returns YES for the call shouldInvalidateLayoutForBoundsChange:. On rotation, the cell in the initial position fades out and the cell in the final position fades in.

By adding the following code to my layout I can disable the fades and the
circle of items appears to to simply rotate with the orientation change:

- (UICollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath {
    return nil;
}

- (UICollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingItemAtIndexPath:(NSIndexPath *)itemIndexPath {
    return [self layoutAttributesForItemAtIndexPath:itemIndexPath];
}

Why do the methods get called on a bounds change because documentation doesn’t seem to suggest they do? Documentation seems to state they get called related to insertion and removal of items from the collection view.

Is there a better way to disable the cross fade during rotation?

Notes:

  • The initialLayoutAttributesForAppearingItemAtIndexPath: documentation
    states that by default the method returns nil but calls to super returned
    non-nil values.
  • I set symbolic breakspoints on the UICollectionView methods
    deleteItemsAtIndexPaths:, moveItemAtIndexPath:toIndexPath: and
    insertItemsAtIndexPaths: and none of them are hit during rotation.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:20:08+00:00Added an answer on June 12, 2026 at 4:20 pm

    The UICollectionViewLayout.h file states

    // This set of methods is called when the collection view undergoes an
         animated transition such as a batch update block or an animated 
         bounds change.
    // For each element on screen before the invalidation, 
         finalLayoutAttributesForDisappearingXXX will be called and an 
         animation setup from what is on screen to those final attributes.
    // For each element on screen after the invalidation, 
         initialLayoutAttributesForAppearingXXX will be called an an 
         animation setup from those initial attributes to what ends up on 
         screen.
    

    which clearly says they are called on bounds changes. Rather than removal/insertion, “old state” and “new state” seems more accurate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im have a subclass of UIView, called PinView, which contains an image. Basically PinView
I have a subclass of UIView which draws itself based on data held in
I have a subclass of UIView in which it has a drawRect in it.
I have a subclass of UIViewController which handles a UIView. The viewcontroller is presented
I have subclass of UIViewController called FullScreenViewController which has a property of type ImageScrollView
I have a subclass baz, which needs to be included in both foo and
OK, I am a little confused. I have a subclass of UIScrollView, which is
I have a subclass of JFrame A. I have another class B which is
I have a subclass of UITableViewCell and I have the layout of the contentView
I have a subclass with an over-ridden method that I know always returns a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.