UICollectionViewCell animation collapses

I am trying to animate the height of a UICollectionViewCell when a user clicks on it.

The core functionality works as expected. It shrinks and expands when clicked, but my UICollectionViewCells are customizable and have a title and content, so when I change the height, it collapses the contents of the ViewView to 0, and only the title is visible the other way around. The problem is that the contentView is just there / gone and is not animated as the cell itself (its supervisor).

See screenshots for a better understanding:

Animation when you click on the title (red). The ContentView is instantly visible, but the cell comes to life behind it:

enter image description here

After the animation is complete, everything is fine: enter image description here

Clicking again collapses the cell as expected, but the contentView (blue) hides instantly: enter image description here

ViewLayout. , - , - .

: UICollectionViewCell , . .

+4

Source: https://habr.com/ru/post/1536803/


All Articles