Presets,
i have collectionViewFlowLayout subclass with
- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds {
return YES;
}
- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect {
NSArray *arr = [super layoutAttributesForElementsInRect:rect];
BBLog(@"ARRA:%@", arr);
for (UICollectionViewLayoutAttributes *attr in arr) {
if (CGAffineTransformIsIdentity(attr.transform)) {
attr.transform = CGAffineTransformMakeRotation((CGFloat)M_PI);
}
}
return arr;
}
CollectionView rotate to upside down scroll with
self.collectionView.transform = CGAffineTransformMakeRotation((CGFloat)M_PI);
But even if jus use native collectionViewFlowLayout without subclassing, a git this error
Problem
I have two messages and more in chat, but when scroll at bottom (top normally) disappear second item.
layoutAttributesForElementsInRect for given rect return two attributes for two indexPaths 0-0 and 0-1, but delegate method
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
called only for indexPath 0-0
Here images
UPDATE So i found WHY it's happen - this line code
attr.transform = CGAffineTransformMakeRotation((CGFloat)M_PI);
Look if remove transform