iOS Orientation UICollectionView

ios, orientation, uicollectionview

Solution

You need to force the application to change layout of the collection view when changing orientation:

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
                               duration:(NSTimeInterval)duration{

    [self.myCollectionView.collectionViewLayout invalidateLayout];
}

See this thread: UICollectionView Set number of columns

Good luck!

Problem

My collectionView presents 20 items in landscape mode. In portrait mode, I only want 8 reusable items presented. How can I achieve this? When does the collectionView call collectionView:numberOfItemsInSection: on the data source in order to update itself???

Original source

Related problems