4
我使用uicollectionview呈現視圖控制器。我希望細胞從頂部進行動畫處理。UICollectionView最初動畫單元格
我的佈局是FlowLayout中的sublclass,所以我重寫此方法:暫時
- (UICollectionViewLayoutAttributes *) initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewLayoutAttributes* attributes = [super initialLayoutAttributesForAppearingItemAtIndexPath:indexPath];
CGFloat height = [self collectionViewContentSize].height;
attributes.transform3D = CATransform3DMakeTranslation(0, -height, 0);
return attributes;
}
它幾乎工作,但我看到的細胞出現(閃存)在屏幕上,他們在動畫之前
任何想法爲什麼他們在應用轉換之前出現在其最終位置,以及我如何防止這種情況?