0

私はUICollectionViewを持っています。ユーザーがセルをタップすると、セルのサイズを拡張する必要があります。私は UICollectionViewCell拡張をアニメーション化する方法は?

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ 
    if(isExpandedMode && expandedPosition == indexPath.row){ 
     CGFloat screenWidth = 568.0; 
     CGFloat screenHeight = 293.0; 
     return CGSizeMake(screenWidth, screenHeight); 
    } 
    else{ 
     CGFloat screenWidth = 172.0; 
     CGFloat screenHeight = 293.0; 
     return CGSizeMake(screenWidth, screenHeight); 
    } 
} 

は今、私はこのコードを書くためのセルの拡大にアニメーションを適用したい、
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { 
    [collectionView performBatchUpdates:^{ 
     isExpandedMode = true; 
     expandedPosition = indexPath.row; 
     [self.collectionView reloadItemsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil]]; 
    } completion:^(BOOL finished) { 

    }]; 
} 

は今、私はここでセルサイズを更新し、このようにこれをやっていますか?

答えて

関連する問題