I want to resize the CollectionViewCell
when the cell is clicked. When the cell is already opened, it needs to be expanded or collapsed. I am removing it with this code so far in didSelectItemAtIndexPath
method:
UICollectionViewCell * myCell = [CollectionViewSelfForItIndexpath: indexpath]; [UIView transitionWithView: collectionView Duration: .3 Options: UIViewAnimationOptionCurveLinear Animation: ^ {CGRect Old Frame = myCell.frame; If ([extended cell is good: myCell]) {extended cell = zero; OldFrame.size.height = 42; } And {extended cell = myCell; OldFrame.size.height = 220; } MyCell.frame = Old Frame; } Closing: ^ (BOOL Finish) {}];
When I expand the last cell, then it works fine. It falls fine but when I click on the cell on index 0, for example, the cell frame is moving below the cell limit. How can I change the frames of all cells after the selected index path? Do not forget, I need an animation when changing all the cell frames.
EDIT: I got an answer to my question with the next few lines of code. The point is that you need to call the reloaded data inside the animation so that the size inside the size ForItemAtIndexPath
will be changed.
You must resize the height in the archive view high rep and rest Load didSelectItem
Comments
Post a Comment