내가 정의 UICollectionViewFlowLayout
을 쓰고 있어요 그리고 내가 컬렉션보기에 performBatchUpdates:completion:
를 호출 할 때 initialLayoutAttributesForAppearingItemAtIndexPath:
및 initialLayoutAttributesForAppearingDecorationElementOfKind:atIndexPath:
이 모든 부분에 대해 호출됩니다 것으로 나타났습니다 애니메이션. 결과는 입니다. 모든 섹션에는 대신 새로 적용된 섹션 인 대신 애니메이션이 적용됩니다. 지금까지 간단한 업데이트 대신 performBatchUpdates:completion:
에 대한 호출을 제거하고 시도했지만, 이미 존재하는 섹션 (모두가) 어쨌든에서 애니메이션 무엇UICollectionView performBatchUpdates : 모든 부분
[collectionView performBatchUpdates:^{
currentModelArrayIndex++;
[collectionView insertSections:[NSIndexSet indexSetWithIndex:currentModelArrayIndex]];
[collectionView reloadSections:[NSIndexSet indexSetWithIndex:currentModelArrayIndex-1]];
} completion:^(BOOL finished) {
[collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:currentModelArrayIndex] atScrollPosition:UICollectionViewScrollPositionTop animated:YES];
}];
. 나는 의 레이아웃 속성을 바꾸고 있는지 확인하기위한 해결책을 생각해 냈다. 마지막 부분이지만, 그것은 해피하다고 느낀다.
if (decorationIndexPath.section == [(id<UICollectionViewDataSource>)self.collectionView.delegate numberOfSectionsInCollectionView:self.collectionView] - 1)
{
layoutAttributes.alpha = 0.0f;
layoutAttributes.transform3D = CATransform3DMakeTranslation(-CGRectGetWidth(layoutAttributes.frame), 0, 0);
}
일부 섹션 만 애니메이션으로 전환하는 적절한 방법입니까?